A-A+

VLAN间单臂路由的拓扑图和实验

2015年11月20日 站长资讯 暂无评论

这个实验是采用一台路由器、一台交换机和两台PC终端来共同组网完成的。具体的ip地址设置和联网参见下面的拓扑图。

实验拓扑:

1.配置pc机ip地址和网关(略)。

2.在交换机上创建VLAN,并将接口加入相应的VLAN中。

  1. en  
  2. conf t  
  3. vlan 10  
  4. vlan 20  
  5. exit  
  6. int f0/1  
  7. switchport mode access  
  8. swithchport access vlan 10  
  9. int f0/2  
  10. switchport mode access  
  11. swithcport access vlan 20  
  12. int f0/3   
  13. switchport mode trunk  
  14. exit  

2.在路由器F0/0上配置子接口,并封装vlan号

  1. en  
  2. conf t  
  3. int f0/0  
  4. no shut  
  5. int f0/0.1  
  6. encapsulation dot1Q 10   *配置以太网子接口vlan号,封装格式为 802.1q  
  7. ip add 192.168.1.254 255.255.255.0  
  8. no http://www.xiaoxiongboke.com shut  
  9. int f0/0.2  
  10. encapsulation dot1Q 20   *不首先配置VLAN号,给子接口设置IP 地址将失败  
  11. ip add 192.168.2.254 255.255.255.0  
  12. no shut  
  13. exit  

3.在路由器上show ip route

4.验证:PC1pingPC2

标签:

给我留言