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 [网络地址][子网掩码]
-
interface FastEthernet0/0
-
no ip address
-
duplex auto
-
speed auto
- !
-
interface FastEthernet0/0.1
-
encapsulation dot1Q 10
-
ip address 192.168.1.1 255.255.255.0
- !
-
interface FastEthernet0/0.2
-
encapsulation dot1Q 20
-
ip address 192.168.2.1 255.255.255.0
- !
6.PC各自ping网关,互ping
验证show ip route
转载于:https://blog.51cto.com/qiansl/698853