目录
🦐博客主页:大虾好吃吗的博客
🦐专栏地址:huawei专栏
- system-view #进入系统视图
- undo info-center enable #关闭信息中心功能
- Sysname daxia #重命名为daxia
- user-interface console 0 #进入控制台后再设置永不超时
- idle-timeout 0 0 #设置永不超时
常用视图名称 | 进入视图 | 视图功能 |
---|---|---|
用户视图 | 用户从终端成功登陆 即进入用户视图,屏幕中显示 | 查看运行状态和统计信息等 |
系统视图 | 输入system-view后进入系统视图,屏幕中显示[Huawei] | 可以配置系统参数以及通过该视图进入其他的功能配置视图 |
接口视图 | 使用interface命令指定接口类型及接口编号进入相应的接口视图,屏幕中显示[Huawei-GigabitEthernet0/0/1] | 常见的接口视图有物理接口、VLAN接口等 |
路由协议视图 | 使用路由协议运行命令进入,屏幕中显示[Huawei-ospf-1] | 路由协议就是在该视图下进行配置的,例如ospf、rip、is-is等协议。 |
trunk模式:允许多个VLAN通过,可以接收和发送多个VLAN报文,一般用于交换机与交换机相关的接口。
access模式:允许一个VLAN通过,一般用于连接计算机的端口。
1、六台PC机配置同一网段IP地址,默认是可以ping通的,现在需要划分VLAN,使其相同VLAN可以ping通,不同VLAN之间不可通信。
2、交换机与交换机之间配置trunk模式,交换机与PC之间配置access模式。
sys - [Huawei]undo info-center enable
- [Huawei]vlan batch 10 20 30
- [Huawei]int e0/0/1
- [Huawei-Ethernet0/0/1]port link-type trunk
- [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
- [Huawei-Ethernet0/0/1]int e0/0/2
- [Huawei-Ethernet0/0/2]port link-type access
- [Huawei-Ethernet0/0/2]port default vlan 10
- [Huawei-Ethernet0/0/2]int e0/0/3
- [Huawei-Ethernet0/0/3]port link-type access
- [Huawei-Ethernet0/0/3]port default vlan 20
- [Huawei-Ethernet0/0/3]int e0/0/4
- [Huawei-Ethernet0/0/4]port link-type access
- [Huawei-Ethernet0/0/4]port default vlan 30
sys - [Huawei]undo info-center enable
- [Huawei]vlan batch 10 20 30
- [Huawei]int e0/0/1
- [Huawei-Ethernet0/0/1]port link-type trunk
- [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
- [Huawei-Ethernet0/0/1]int e0/0/2
- [Huawei-Ethernet0/0/2]port link-type access
- [Huawei-Ethernet0/0/2]port default vlan 10
- [Huawei-Ethernet0/0/2]int e0/0/3
- [Huawei-Ethernet0/0/3]port link-type access
- [Huawei-Ethernet0/0/3]port default vlan 20
- [Huawei-Ethernet0/0/3]int e0/0/4
- [Huawei-Ethernet0/0/4]port link-type access
- [Huawei-Ethernet0/0/4]port default vlan 30
下面我使用60主机访问同一个VLAN的50主机,网络反馈是相互通信的,访问其他VLAN的PC机将反馈找不到主机,表示本次测试完成。
- PC>ping 1.0.0.50
-
- Ping 1.0.0.50: 32 data bytes, Press Ctrl_C to break
- From 1.0.0.50: bytes=32 seq=1 ttl=128 time=62 ms
- From 1.0.0.50: bytes=32 seq=2 ttl=128 time=78 ms
- From 1.0.0.50: bytes=32 seq=3 ttl=128 time=79 ms
- From 1.0.0.50: bytes=32 seq=4 ttl=128 time=78 ms
- From 1.0.0.50: bytes=32 seq=5 ttl=128 time=47 ms
-
- --- 1.0.0.50 ping statistics ---
- 5 packet(s) transmitted
- 5 packet(s) received
- 0.00% packet loss
- round-trip min/avg/max = 47/68/79 ms
-
- PC>ping 1.0.0.30
-
- Ping 1.0.0.30: 32 data bytes, Press Ctrl_C to break
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
-
- --- 1.0.0.30 ping statistics ---
- 5 packet(s) transmitted
- 0 packet(s) received
- 100.00% packet loss
-
- PC>ping 1.0.0.40
-
- Ping 1.0.0.40: 32 data bytes, Press Ctrl_C to break
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
- From 1.0.0.60: Destination host unreachable
-
- --- 1.0.0.40 ping statistics ---
- 5 packet(s) transmitted
- 0 packet(s) received
- 100.00% packet loss