单臂路由
SW1 配置如下:
Switch>en
Switch#vlan d ************** 进入VLAN配置模式
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vlan 10 ************** 创建 VLAN10
VLAN 10 added:
Name: VLAN0010
Switch(vlan)#vlan 20 ************** 创建 VLAN20
VLAN 20 added:
Name: VLAN0020
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1 ************** 进主接口
Switch(config-if)#sw m t ************** 改为双工模式
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch(config-if)#int f0/2 ************** 进子接口
Switch(config-if)#sw mo acc ************** 改为单工模式
Switch(config-if)#sw acc vlan 10 ************** 将其加入VLAN10
Switch(config-if)#int f0/3 ************** 进子接口
Switch(config-if)#sw mo acc ************** 改为单工模式
Switch(config-if)#sw acc vlan 20 ************** 将其加入VLAN10
Switch(config-if)#exit
Switch(config)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig1/1, Gig1/2
10 VLAN0010 active Fa0/2
20 VLAN0020 active Fa0/3
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 enet 101002 1500 - - - - - 0 0
1003 enet 101003 1500 - - - - - 0 0
1004 enet 101004 1500 - - - - - 0 0
1005 enet 101005 1500 - - - - - 0 0
SW2 、 SW3 不需配置。
路由配置:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0 *********** 进主接口
Router(config-if)#no sh *********** 开启主接口
Router(config-if)#int f0/0.1 *********** 进子接口
Router(config-subif)#encapsulation dot1Q 10 ********** 使用dot1Q协议
Router(config-subif)#ip add 10.0.0.1 255.0.0.0 ********** 添加IP
Router(config-subif)#int f0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.0.1 255.255.255.0