单臂路由配置演示

一.思路:

二.配置:

1.路由器配置

2.交换机配置

3.测试


单臂路由配置演示_第1张图片

一.思路:

路由器创建两个子接口分别对应转发两个VLAN的数据,交换机E0/0/1接口配置trunk,允许收发多条VLAN数据,PC1端划入VLAN10,PC2端划入VLAN20

二.配置:

1.路由器配置

[r1]interface GigabitEthernet 0/0/0.10
[r1-GigabitEthernet0/0/0.10]dot1q termination vid 10
[r1-GigabitEthernet0/0/0.10]ip address 192.168.2.1 24
Apr 14 2023 16:25:21-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0.10 has entered the UP state. 
[r1-GigabitEthernet0/0/0.10]undo shutdown 
Info: Interface GigabitEthernet0/0/0.10 is not shutdown.
[r1-GigabitEthernet0/0/0.10]q
[r1]interface GigabitEthernet 0/0/0.20
[r1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[r1-GigabitEthernet0/0/0.20]ip address 192.168.6.1 24
Apr 14 2023 16:25:56-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/0.20 has entered the UP state. 
[r1-GigabitEthernet0/0/0.20]undo shutdown 
Info: Interface GigabitEthernet0/0/0.20 is not shutdown.
[r1-GigabitEthernet0/0/0.20]q

2.交换机配置

[r1]interface Eth0/0/2
[r1-Ethernet0/0/2]port link-type access 
[r1-Ethernet0/0/2]port default vlan 10
[r1-Ethernet0/0/2]q
[r1]interface Eth0/0/3
[r1-Ethernet0/0/3]port link-type access 
[r1-Ethernet0/0/3]port default vlan 20
[r1-Ethernet0/0/3]q
[r1]interface Eth0/0/1
[r1-Ethernet0/0/1]port link-type trunk 
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan 10 20
[r1-Ethernet0/0/1]q

3.测试

PC1和PC2互ping

PC>ping 192.168.6.135

Ping 192.168.6.135: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.6.135: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.6.135: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.6.135: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.6.135: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.6.135 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/74/78 ms
PC>ping 192.168.2.135

Ping 192.168.2.135: 32 data bytes, Press Ctrl_C to break
From 192.168.2.135: bytes=32 seq=1 ttl=127 time=79 ms
Request timeout!
From 192.168.2.135: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.135: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.135: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.2.135 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 78/78/79 ms

你可能感兴趣的:(HW网络,#,交换,智能路由器,网络,华为,单臂路由,交换机)