Switch lab—单臂路由

最简单的路由转发拓扑—单臂路由

1.switch0新建vlan 10,20

2.switch0与switch1 建立VTP server和client,互相学习vlan

3.交换机间trunk模式,allowed vlan all

switch0和router0间trunk模式,allowed vlan all

4.两台PC不同vlan不同网段

vlan 10   PC0 192.168.1.254 255.255.255.0 192.168.1.1

vlan 20   PC1 192.168.2.254 255.255.255.0 192.168.2.1

5.router0与switch0相连口起子接口

子接口配置规则:

interface f0/x

    no shut

interface f0/x.[1~410000]

    encapsulation dotlq [vlan ID]

    ip address [网络地址][子网掩码]


  1. interface FastEthernet0/0 
  2.  no ip address 
  3.  duplex auto 
  4.  speed auto 
  5.  
  6. interface FastEthernet0/0.1 
  7.  encapsulation dot1Q 10 
  8.  ip address 192.168.1.1 255.255.255.0 
  9.  
  10. interface FastEthernet0/0.2 
  11.  encapsulation dot1Q 20 
  12.  ip address 192.168.2.1 255.255.255.0 

 

 6.PC各自ping网关,互ping

验证show ip route