实验环境图
单臂路由:将不同vlan通过路由器相互通信。
下面进行配置:
①:首先对switch进行配置
switch >enable
switch #vlan database
switch(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
switch(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
switch(vlan)#vlan 4
VLAN 4 added:
Name: VLAN0004
switch(vlan)#exit
switch #conf ter
switch (config)#inter f0/0
switch (config-if)#switchport mode trunk
switch (config-if)#exit
switch (config)#inter f0/1
switch (config-if)#switchport access vlan 2
switch (config-if)#inter f0/2
switch (config-if)#switchport access vlan 3
switch (config-if)#inter f0/3
switch (config-if)#switchport access vlan 4
交换机配置完了
②:下面对route进行配置
route >enable
route #conf ter
route (conf ig)#inter f0/0
route (conf ig-if)#no sh
route (conf ig-if)#exit
router(config)#inter f0/0.1
route (conf ig-if)#encapsulation dot1Q 10
route (conf ig-if)#ip add 192.1.1.1 255.255.255.0
router(config)#inter f0/0.2
route (conf ig-if)#encapsulation dot1Q 20
route (conf ig-if)#ip add 192.1.2.1 255.255.255.0
router(config)#inter f0/0.3
route (conf ig-if)#encapsulation dot1Q 30
route (conf ig-if)#ip add 192.1.3.1 255.255.255.0
路由器配置完了。
给pc配置ip和网关
通了:成功
此实验笔者是通过小凡软件实验的(大型网络做单臂原理也是一样).