找回密码
 注册
首页 ≡≡网络技术≡≡ 网络技术 神州数码交换机路由器“Telnet”配置命令使用方法详解 ...

神州数码交换机路由器“Telnet”配置命令使用方法详解

灰儿 2017-6-12 16:56:43
神州数码其实是思科在中国的总代理商,神州数码的网络设备与思科的网络设备命令行95%以上是一样的,会思科的直接上去配,不会空格+?一样查的出来的。

第一部分:交换机配置:
1.       基本配置:
开启SSH服务:debug ssh-server
设置特权模式密码:enable password [8] <password>   注释:8为加密的密码
设置退出特权模式超时时间::exec-timeout <minutes > [<seconds>]
                            Switch(config)#exec-timeout 5 30(退出时间为5分30秒)
更改主机名:hostname 主机名
设置主机名与IP地址的映射关系:Switch(config)#ip host beijing 200.121.1.1(beijing为主机)
开启web配置服务:Switch(config)#ip http serve
显示帮户信息的语言类型:language {chinese|english}
使用密码验证:login
使用本地用户密码验证:Switch(config)#login local
设置用户在 console上进入一般用户配置模式时的口令:Switch(config)#password 8 test
热启动交换机:reload
加密系统密码:service password-encryption
恢复交换机出厂配置:set default
保存当前配置:write
配置交换机作为 Telnet 服务器允许登录的 Telnet 客户端的安全 IP 地址:Switch(config)#telnet-server securityip 192.168.1.21
设置Telnet 客户端的用户名及口令:Switch(config)#telnet-user Antony password 0 switch
打开交换机的 SSH服务器功能:Switch(config)#ssh-server enable
设置SSH客户端的用户名及口令:Switch(config)#ssh-user switch password 0 switch
通过DHCP 方式获取 IP 地址。
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ip dhcp-client enable
Switch(Config-if-Vlan1)#exit
交换机 Switch1 端口 1 同交换机 Switch2 端口 1 用线相连,将该两个端口设置为强制
100Mbit/s  速率,半双工模式。
Switch1(config)#interface ethernet1/1
Switch1(Config-If-Ethernet1/1)#speed-duplex force100-half
Switch2(config)#interface ethernet1/1
Switch2(Config-If-Ethernet1/1)#speed-duplex force100-half
配置名称为 test的隔离组。
Switch>enable
Switch#config
Switch(config)#isolate-port group test
打开LACP调试开关。
Switch#debug lacp
新建一个 port group,并且采用默认的流量分担方式。
Switch (config)#port-group 1
删除一个 port group
Switch (config)#no port-group 1
在 Ethernet1/1 端口模式下,将本端口以 active 模式加入port-group 1。
Switch (Config-If-Ethernet1/1)#port-group 1 mode active
删除端口 1 动态MAC。
Switch#clear port-security dynamic interface Ethernet 1/1
使能端口 1 的MAC 地址绑定功能。
Switch(config)#interface Ethernet 1/1
Switch(Config-If-Ethernet1/1)#switchport port-security
将端口 1 的MAC地址转化为静态安全 MAC 地址。
Switch(config)#interface Ethernet 1/1
Switch(Config-If-Ethernet1/1)#switchport port-security convert
添加MAC 00-03-0F-FE-2E-D3 到端口 1
Switch(config)#interface Ethernet 1/1
Switch(Config-If-Ethernet1/1)#switchport port-security mac-address 00-03-0F-FE-2E-D3
设置端口 1 安全MAC 地址上限为 4。
Switch(config)#interface Ethernet 1/1
Switch(Config-If-Ethernet1/1)#switchport port-security maximum 4
设置端口 1 的违背模式为 shutdown。
Switch(config)#interface Ethernet 1/1
Switch(Config-If-Ethernet1/1)#switchport port-security violation shutdown

生成树配置:
配置VLAN1-10;100-110 与 Instance 1的映射关系。
Switch(config)#spanning-tree mst configuration
Switch(Config-Mstp-Region)#instance 1 vlan 1-10;100-110
配置修正数值为 2000。
Switch(config)#spanning-tree mst configuration
Switch(Config-Mstp-Region)# revision-level 2000
开启和关闭生成树
Switch(config)#spanning-tree
Switch(config)#interface ethernet 1/2
Switch(Config-If-Ethernet1/2)#no spanning-tree
设置交换机运行 STP模式。
Switch(config)#spanning-tree mode stp
在端口 1/2 设置实例 1 的端口优先级为 32。
Switch(config)#interface ethernet 1/2
Switch(Config-If-Ethernet1/2)#spanning-tree mst 1 port-priority 32
配置交换机实例 2 的优先级为 4096。
Switch(config)#spanning-tree mst 2 priority 4096

访问控制列表配置:
使能在 Tuesday到 Saturday内的 9:15:30到 12:30:00时间段内配置生效
Switch(config)#time-range dc_timer
Switch(Config-Time-Range-dc_timer)#absolute-periodic tuesday 9:15:30 to saturday 12:30:00
使能在 Monday、Wednesday、Friday和 Sunday四天内的 14:30:00到 16:45:00 时间段配置生
Switch (Config-Time-Range-dc_timer)#periodic  monday wednesday friday sunday 14:30:00 to
16:45:00

创建编号为110的数字扩展访问列表。拒绝icmp报文通过,允许目的地址为192.168.0.1
目的端口为 32 的udp 包通过。
Switch(config)#access-list 110 deny icmp any-source any-destination
Switch(config)#access-list 110 permit udp any-source host-destination 192.168.0.1 d-port 32

创建一条编号为 20的数字标准 IP访问列表,允许源地址为 10.1.1.0/24 的数据包通过,
拒绝其余源地址为 10.1.1.0/16 的数据包通过。
Switch(config)#access-list 20 permit 10.1.1.0 0.0.0.255
Switch(config)#access-list 20 deny 10.1.1.0 0.0.255.255

允许源 MAC 地址为 00-00-XX-XX-00-01 的数据包通过,拒绝源地址为
00-00-00-XX-00-ab 的数据包通过。
Switch(config)# access-list 700 permit 00-00-00-00-00-01 00-00-FF-FF-00-00
Switch(config)# access-list 700 deny   00-00-00-00-00-ab 00-00-00-FF-00-00

允许源地址为 10.1.1.0/24 的数据包通过,拒绝其余源地址为 10.1.1.0/16 的数据包通
过。
Switch(config)# ip access-list standard ipFlow
Switch(Config-Std-Nacl-ipFlow)# permit 10.1.1.0 0.0.0.255
Switch(Config-Std-Nacl-ipFlow)# deny 10.1.1.0 0.0.255.255




二层交换机配置:
1.基本配置:enable 进入特权模式
            config 禁进入全局配置模式
            hostname 更改设备名称
1.使用TFTP上传文件:
show flash
copy startup-config tftp://192.168.2.10/sw1-config01
2.配置telnet服务:
telnet-server enable
telnet-user admin password 0 admin
telnet-server secu 192.168.2.1  指定特定的IP远程登录
3.http登录:
ip http server
web-user dcnu password 0 dcnu指定登录用户名和密码
4.交换机vlan的配置:
vlan 10
switchport interface ethernet 0/0/1-10
5.端口镜像:
monitor session 1 source interface ethernet 0/0/1;10;24
monitor session 1 destination interface ethernet 0/0/23
6.端口MAC地址绑定:
sw port-security
sw port-security mac-address 00-0B-CD-4A-23-AF
查看mac地址表:show mac-address-table
7.AM实现端口IP和MAC地址绑定:
am enable
am mac-ip-pool mac地址 IP地址
8.生成树配置:
开启和关闭生成树:span no span
针对特定端口开启和关闭生成树:int e0/0/1  span/no span
mstp配置:span mstp config
         name dcnu
         instance 1 vlan 10
         instance 2 vlan 20
指定优先级:span mstp 1 priority 4096
            span mstp 2 priority 61440
指定特定端口的优先级:int e0/0/1
                      span mstp 1 port-poriority 16
                      span mstp 2 port-poriority 240

三层交换机DHCP和中继的配置:
1.DHCP配置:vlan 10
            vlan 20
            int vlan 10
            ip add 192.168.1.1 255.255.255.0
            int vlan 20
            ip add 192.168.2.1 255.255.255.0
            service dhcp
            ip dhcp pool 1
            network-address 192.168.1.0 24
            default-router 192.168.1.1
            ip dhcp pool 2
            network-address 192.168.2.0 24
            default-router 192.168.2.1

2.DHCP中继:ip forward-protocol udp bootps
            int vlan 10
            ip help 10.1.1.1
            ip route 10.1.1.0 255.255.255.0 192.168.1.1
路由器配置:
1.ospf路由器配置:
router ospf 100
network 192.168.1.1 255.255.255.0 area 0
接口权值配置:ip ospf cost 值
路由重分发:redistribute ospf 区域号 redistribute rip

下面的配置在路由器A和B之间配置一条 virtua link。
路由器 A(router-id: 200.200.200.1)上的配置:
!
router ospf 100
network 192.168.20.0 255.255.255.0 area 1
    area 1 virtual-link 200.200.200.2
路由器 B(router-id: 200.200.200.2)上的配置:
router ospf 100
network 192.168.30.0 255.255.255.0 area 1
    area 1 virtual-link 200.200.200.1
策略路由配置:
创建ACL:ip access-list standard net1 permit 10.1.1.2 255.255.255.255
创建router-map:router-map
               router-map pbr 10 permit
               match ip addess net1 set ip next-hop 13.1.1.99
绑定在进入的接口上:interface fastethernet 0/0
                    ip policy route-map pbr

RouterA配置:
Router>enable
Router#conf
Router_config#hostname RouterA
RouterA_config#username RouterB password 1234            设置账号密码
RouterA_config#int s0/1
RouterA_config_s0/1#ip address 192.168.1.1 255.255.255.0
RouterA_config_s0/1#encapsulation ppp                     封装PPP协议
RouterA_config_s0/1#ppp authentication chap                 设置验证方式
RouterA_config_s0/1#ppp chap hostname RouterA             设置发给对方验证的账号
RouterA_config_s0/1#physical-layer speed 64000              设置DCE时钟频率
RouterA_config_s0/1#no shut
RouterA_config_s0/1#exit
RouterA_config#aaa authentication ppp default local            配置aaa的ppp认证方法表
RouterB配置:
Router>enable
Router#conf
Router_config#hostname RouterB
RouterB_config#username RouterA password 1234            设置账号密码
RouterB_config#int s0/1
RouterB_config_s0/1#ip address 192.168.1.2 255.255.255.0
RouterB_config_s0/1#encapsulation ppp                     封装PPP协议
RouterB_config_s0/1#ppp authentication chap                 设置验证方式
RouterB_config_s0/1#ppp chap hostname RouterB             设置发给对方验证的账号
RouterB_config_s0/1#no shut
RouterB_config_s0/1#exit
RouterB_config#aaa authentication ppp default local            配置aaa的ppp认证方法表
注意:接口和协议都必须是UP;如果协议是down,通常是因为封装不匹配、DCE没有设置时钟等。
交换机的端口聚合:
DCS-3950-26C(config)#port-group 1
DCS-3950-26C(config)#int e0/0/1
DCS-3950-26C(config-if-ethernet0/0/1)#port-group 1 mode on
DCS-3950-26C(config-if-ethernet0/0/1)#int e0/0/5
DCS-3950-26C(config-if-ethernet0/0/5)#port-group 1 mode on

接下来,在5650上开启port-group
DCRS-5650-28(config)#port-group 1
DCRS-5650-28(config)#int e0/0/10
DCRS-5650-28(Config-If-Ethernet0/0/10)#port-group 1 mode on
DCRS-5650-28(Config-If-Ethernet0/0/10)#int e0/0/15
DCRS-5650-28(Config-If-Ethernet0/0/15)#port
DCRS-5650-28(Config-If-Ethernet0/0/15)#port-group 1 mo on
通过dhcp snooping 实现PCC的IP地址、MAC地址与SWA的端口进行三元组绑定,要求SWA的0/1接口只允许PCC的IP接入。
配置静态绑定用户:
ip dhcp snooping binding enable
ip dhcp snooping binding user 00-03-0f-12-34-56 address 192.168.1.16
255.255.255.0 interface Ethernet 0/1
灰儿 楼主 2017-6-19 14:16:11
常用命令(特权用户配置模式):
Switcht#
Switcht#config             //进入全局配置模式
Switcht#show version  //显示交换机版本信息
Switcht#show arp      //显示arp映射表
Switcht#show clock   //显示系统当前的时钟
Switcht#show vlan   //显示vlan
Switcht#show running-config   //显示当前运行状态下生效的交换机参数配置
Switcht#show inter    //显示端口状态
switch#show int f0/0      //查看指定端口信息
Switcht#show mac-address-table    //显示交换机当前的mac地址表内容
Switcht#ip http server   //使能web配置
Switcht#setup          //进入交换机的setup配置模式
Switcht#write   //保存当前配置
Switcht#exit   //退出连接
您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。