三层交换VLAN间路由

拓扑图:

img

要求:

  1. 修改主机名为拓扑显示的名称
  2. 创建VLAN
  3. 将相应的端口加入VLAN
  4. 相应的端口配置成Trunk
  5. VLANif接口配置成网络内最后一个可用IP地址
  6. 配置PC机的IP地址,测试不同VLAN的PC是否能正常通信

配置过程:

LSW1:

sys
sys LSW1
un in e
v b 10 20
int e0/0/10
p l a
p d v 10
int e0/0/2
p l a
p d v 10

int e0/0/1
p l t
p t a v 10 20

LSW2:

sys
sys LSW2
un in e
v b 10 20
int e0/0/3
p l a
p d v 20
int e0/0/4
p l a
p d v 20

int e0/0/1
p l t 
p t a v 10 20

LSW3:

sys
sys LSW3
un in e
v b 10 20
int g0/0/1
p l t
p t a v 10 20
int g0/0/2
p l t
p t a v 10 20

int vlanif 10
ip add 192.168.100.62 26
int vlanif 20
ip add 192.168.200.62 26

测试连通性

PC1 PING PC3:

PC>ping 192.168.200.1

Ping 192.168.200.1: 32 data bytes, Press Ctrl_C to break
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable

--- 192.168.100.62 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC1 PING 网关地址:

PC>ping 192.168.100.254

Ping 192.168.100.254: 32 data bytes, Press Ctrl_C to break
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable

--- 192.168.100.62 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

LSW3路由表:

[LSW3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 6        Routes : 6        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
192.168.100.192/26  Direct  0    0           D   192.168.100.254 Vlanif10
192.168.100.254/32  Direct  0    0           D   127.0.0.1       Vlanif10
192.168.200.192/26  Direct  0    0           D   192.168.200.254 Vlanif20
192.168.200.254/32  Direct  0    0           D   127.0.0.1       Vlanif20