单臂路由

单臂路由原理:

路由器重新封装MAC 转换VLAN 标签

  • 路由器的物理接口可以被划分成多个逻辑接口
  • 每个子接口对应一个VLAN网段的网段
    单臂路由基本配置:
    单臂路由_第1张图片交换机配置:
 <Huawei>system-view 
 [Huawei]vlan batch 10 20
 [Huawei]int Ethernet0/0/1
 [Huawei-Ethernet0/0/1]port link-type access 
 [Huawei-Ethernet0/0/1]port default  vlan 10
  [Huawei]int Ethernet0/0/2
 [Huawei-Ethernet0/0/1]port link-type access 
 [Huawei-Ethernet0/0/1]port default  vlan 20
 [Huawei]int g0/0/1
 [Huawei-GigabitEthernet0/0/1]port link-type trunk
 [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

路由器配置 :

<Huawei>system-view 
[Huawei]int GigabitEthernet 0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10
[Huawei-GigabitEthernet0/0/0.1]ip address 10.10.0.1 24
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable 

[Huawei]int GigabitEthernet 0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]dot1q termination  vid  20
[Huawei-GigabitEthernet0/0/0.2]ip address 10.20.0.1 24
[Huawei-GigabitEthernet0/0/0.2]arp broadcast enable 

pc1 ping pc2

PC1>ping 10.20.0.20

Ping 10.20.0.20: 32 data bytes, Press Ctrl_C to break
From 10.20.0.20: bytes=32 seq=1 ttl=127 time=78 ms
From 10.20.0.20: bytes=32 seq=2 ttl=127 time=79 ms
From 10.20.0.20: bytes=32 seq=3 ttl=127 time=62 ms
From 10.20.0.20: bytes=32 seq=4 ttl=127 time=78 ms
From 10.20.0.20: bytes=32 seq=5 ttl=127 time=78 ms

--- 10.20.0.20 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 62/75/79 ms

pc2 ping pc1

PC2>ping 10.10.0.10

Ping 10.10.0.10: 32 data bytes, Press Ctrl_C to break
From 10.10.0.10: bytes=32 seq=1 ttl=127 time=78 ms
From 10.10.0.10: bytes=32 seq=2 ttl=127 time=78 ms
From 10.10.0.10: bytes=32 seq=3 ttl=127 time=78 ms
From 10.10.0.10: bytes=32 seq=4 ttl=127 time=94 ms
From 10.10.0.10: bytes=32 seq=5 ttl=127 time=78 ms

--- 10.10.0.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 78/81/94 ms

你可能感兴趣的:(单臂路由)