【网络工程师配置篇】华为、H3C、锐捷交换机配置命令,网络工程师必备...
发布网友
发布时间:2024-10-24 08:22
我来回答
共1个回答
热心网友
时间:2024-10-25 04:17
一、华为交换机基础配置命令
1. 常用命令视图
创建VLAN:
system-view
[Huawei]vlan 100
[Huawei-vlan100]quit
将端口加入到VLAN中:
[Huawei] interface GigabitEthernet2/0/1
[Huawei- GigabitEthernet2/0/1] port link-type access
[Huawei- GigabitEthernet2/0/1] port default vlan 100
多个端口加入到VLAN中:
[Huawei]vlan 10
[Huawei-vlan10]port GigabitEthernet 1/0/0 to 1/0/29
配置IP地址:
[Huawei] interface Vlanif100
[Huawei-Vlanif100] ip address 192.168.1.1 255.255.255.0
配置默认网关:
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.254
保存设置和重置命令:
save
reset saved-configuration
reboot
显示命令:
display current-configuration
display device
display interface xxx
display version
display vlan xxx
二、H3C交换机基础配置
基本配置:
system-view
[H3C] sysname xxx
用户配置:
[H3C]super password H3C
vlan配置:
[H3C]vlan 2
交换机IP配置:
[H3C]vlan 20
DHCP客户端配置:
[H3C-Vlan-interface20]ip address dhcp-alloc
端口配置:
[H3C-Ethernet0/3]shutdown
端口安全:
(config)# interface fastethernet 0/1
(config-if)# switchport port-security
a、配置最大连接数限制
(config-if)# switchport port-secruity maxmum 1
b、IP和MAC地址绑定
(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
三层路由功能:
(config)# ip routing
(config)# interface fastethernet 0/1
(config-if)# no switchport
(config-if)# ip address 192.168.1.1 255.255.255.0
(config-if)# no shutdown
三层交换机路由协议:
(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1
(config)# router rip
(config-router)# network 172.16.1.0
(config-router)# version 2
(config-router)# no auto-summary
(config)# router ospf
(config)# router ospf 1
(config-router)# network 192.168.1.0 0.0.0.255 area 0
三、锐捷交换机基础命令配置
基础命令:
>Enable
#Exit
#End
#copy running-config startup-config
#del flash:config.text
#erase startup-config
#del flash:vlan.dat
#Configure terminal
(config)# hostname switchA
(config)# banner motd &
(config)#enable secret level 1 0 star
(config)#enable secret level 15 0 star
(config)#enable services web-server
查看信息:
#show running-config
#show interface fastethernet 0/3
#show interface serial 1/2
#show interface
#show ip interface brief
#show ip interface
#show version
#show mac-address-table
#show running-config
#show vlan
#show vlan id 10
#show interface fastethernet 0/1
#show aggregateport 1 summary
#show spanning-tree
#show spanning-tree interface fastethernet 0/1
#show port-security
#show port-security address
#show ip access-lists listname
端口基本配置:
(config)#Interface fastethernet 0/3
(config-if)#speed 10
(config-if)#duplex full
(config-if)#no shutdown
(config-if)#switchport access vlan 10
(config-if)#switchport mode trunk
(config-if)#port-group 1
端口聚合配置:
(config)# interface aggregateport 1
(config-if)# switchport mode trunk
(config-if-range)#port-group 1
生成树:
配置多生成树协议:
switch(config)#spanning-tree
switch(config)#spanning-tree mst configuration
switch(config-mst)#name ruijie
switch(config-mst)#instance 0 vlan 10,20
switch(config-mst)#instance 1 vlan 30,40
switch(config)#spanning-tree mst 0 priority 4096
switch(config)#spanning-tree mst 1 priority 8192
vlan的基本配置:
(config)#vlan 10
(config-vlan)#name vlanname
(config-if)#switchport access vlan 10
(config-if)# ip address 192.168.1.1 255.255.255.0
(config-if)# no shutdown
端口安全:
(config)# interface fastethernet 0/1
(config-if)# switchport port-security
a、配置最大连接数限制
(config-if)# switchport port-secruity maxmum 1
b、IP和MAC地址绑定
(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
三层路由功能:
(config)# ip routing
(config)# interface fastethernet 0/1
(config-if)# no switchport
(config-if)# ip address 192.168.1.1 255.255.255.0
(config-if)# no shutdown
三层交换机路由协议:
(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1
(config)# router rip
(config-router)# network 172.16.1.0
(config-router)# version 2
(config-router)# no auto-summary
(config)# router ospf
(config)# router ospf 1
(config-router)# network 192.168.1.0 0.0.0.255 area 0