华三交换机配置基础命令

网友投稿 2299 2022-09-15


华三交换机配置基础命令

display version ---------查看版本信息,包括交换机的软件和硬件版本信息

reset saved-configuration   -----------恢复出厂设置

The saved configuration file will be erased. Are you sure? [Y/N]:y---------------这里输入y确认

reboot -------------恢复出厂设置需要重启交换机

Start to check configuration with next startup configuration file, please wait.........DONE!

Current configuration may be lost after the reboot, save current configuration? [Y/N]:n-----------这里提示是否保存设置,输入n

This command will reboot the device. Continue? [Y/N]:y--------------------这里提示是否继续,输入y。注意哪里是y哪里是n,否则不能恢复。

设置时间日期,需要先执行  clock protocol none命令

clock datetime 08:31:30 2019/05/27

To manually set the system time, execute the clock protocol none command first.

system

[H3C]clock protocol none

[H3C]quit

clock datetime 08:34:30 2019/05/27

如需设置console口连时的密码,或者采用 用户名/密码 认证方式,需进入用户接口。

[H3C]user-interface aux 0

[H3C-line-aux0]authentication-mode ?

none      Login without authentication

password  Password authentication

scheme    Authentication use AAA

[H3C-line-aux0]authentication-mode password

[H3C-line-aux0]set authentication password simple 1234abcd

user-interface vty 0 4 配置虚拟终端

authentication-mode scheme  认证方式为aaa

user-role network-admin  设置用户为管理员级别

user-role network-operator

protocol inbound all  允许所有协议

允许telnet访问,需先开启telnet服务,再进行后续配置

[H3C]telnet server enable ---------------开启telnet服务

[H3C]ip enable---------------开启mode rstp---------------stp模式设置为rstp

[H3C]stp enable---------------开启stp功能

[H3C]user-interface vty 0 14

[H3C-line-vty0-14]

[H3C-line-vty0-14]protocol inbound telnet

[H3C-line-vty0-14]authentication-mode password

[H3C-line-vty0-14]set authentication password simple Sz123456

[H3C-line-vty0-14]user-role level-15

[H3C-line-vty0-14]idle-timeout 6 0

[H3C-line-vty0-14]screen-length 100

[H3C-line-vty0-14]history-command max-size 256

建立一个用户admin,用于web登录(用浏览器登录)

[H3C]local-user admin

New local user added.

[H3C-luser-manage-admin]authorization-attribute user-role level-15

[H3C-luser-manage-admin]service-type simple Sz123456

建立一个vlan interface,并设置IP地址,用于网页登录和telnet管理,不建议使用vlan1

[H3C]vlan 255

[H3C-vlan255]quit

[H3C]interface Vlan-interface 255

[H3C-Vlan-interface255]ip address 192.168.255.1 255.255.255.0

根据需要设置stp模式

[H3C]stp mode ?

mstp  Multiple spanning tree protocol mode

pvst  Per-Vlan spanning tree mode

rstp  Rapid spanning tree protocol mode

stp   Spanning tree protocol mode

开启DHCP服务,建立不同的IP地址池,对应不同的Vlan,建立相应的vlan-interface,设置IP地址,做为网关

[H3C]dhcp enable----------全局开启dhcp功能

[H3C]dhcp server ip-pool 192.168.100.0-------------定义一个地址池名字

gateway-list 192.168.100.254---------------设置网关地址

network 192.168.100.0 mask 255.255.255.0-------------------设置网段

address range 192.168.100.1 192.168.100.240-------------------设置地址池的IP地址集合

dns-list 114.114.114.114 8.8.8.8------------------设置dns服务器地址

expired day 0 hour 0 minute 40------------------设置租期时长

[H3C]dhcp server ip-pool 172.16.1.0

gateway-list 172.16.1.254

network 172.16.1.0 mask 255.255.255.0

address range 172.16.1.1 172.16.1.240

dns-list 114.114.114.114 8.8.8.8

expired day 0 hour 0 minute 30

[H3C]vlan 100-----------建立vlan

[H3C-vlan100]quit

[H3C]interface Vlan-interface 100--------------建立vlan  interface

[H3C-Vlan-interface100]

ip address 192.168.100.254 255.255.255.0----------------设置vlan-interface的IP地址

dhcp select server------------------设置dhcp为服务端,会自动匹配地址池

[H3C]vlan 601

[H3C-vlan601]quit

[H3C]interface Vlan-interface 601

[H3C-Vlan-interface601]

ip address 172.16.1.254 255.255.255.0

dhcp select server

设置qos策略,使访客网段与办公网段不能互通,在全局应用

[H3C]acl advanced 3001

rule 1000 deny ip source 172.16.0.0 0.0.255.255 destination 192.168.0.0 0.0.255.255

--------------创建一个高级ACL,设置规则1000号(号码不是特别重要)。拒绝源地址172开头的,访问目标地址192开头的。

[H3C]traffic classifier noguest operator and

if-match acl 3001-----------------定义一个类

[H3C]traffic behavior noguest

filter deny-------------------定义一个流行为

[H3C]qos policy noguest

classifier noguest behavior noguest-----------------定义一个策略,为类指定流行为,将类和流行为二者组合起来

[H3C]qos apply policy noguest global inbound --------------------在全局上应用qos策略,方向为入方向

设置链路聚合

[H3C]interface Bridge-Aggregation 1----------------创建一个聚合端口

[H3C-Bridge-Aggregation1]port link-type trunk----------------设置这个端口的属性,如link-type,vlan等

[H3C-GigabitEthernet1/0/23]port link-aggregation group 1 force----------------将这个端口加入聚合组,最后的force 参数可将聚合组的属性同步到此端口,省去手动配置的步骤

[H3C-GigabitEthernet1/0/24]port link-aggregation group 1 force

创建vlan,将端口加入vlan,更改端口模式

[H3C]vlan 100-----------------创建vlan100

[H3C-vlan100]port GigabitEthernet 1/0/1 to g 1/0/10-----------------将1 to10口都划入vlan100(华三交换机的端口,默认类型是access,可以直接加入vlan

[H3C-GigabitEthernet1/0/11]port link-type trunk-----------------进入G1/0/11端口,更改link-type为trunk

[H3C-GigabitEthernet1/0/11]port trunk pvid vlan 100-----------------设置trunk端口的pvid

[H3C-GigabitEthernet1/0/11]port trunk permit vlan 2 to 4000-----------------设置trunk端口允许通过的vlan ID

[H3C-GigabitEthernet1/0/11]undo port trunk permit vlan 1-----------------禁止trunk端口允许vlan1通过(在比较大的企业局域网里,不要使用vlan1)

查看接口IP地址状态

display ip interface brief


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:IPsec实验演示(Huawei路由器设备配置)(华三路由器ipsec配置)
下一篇:解决java Graphics drawImage 无法显示图片的问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~