配置步骤
步骤 1 配置RouterA
# 配置RouterA的接口GE0/0/1、GE0/0/2、GE0/0/3、GE0/0/4、GE0/0/5为交换式接口。
[rt1]int g0/0/1
[rt1-GigabitEthernet0/0/1]portswitch
[rt1-GigabitEthernet0/0/1]q
[rt1]int g0/0/2
[rt1-GigabitEthernet0/0/2]portswitch
[rt1-GigabitEthernet0/0/2]q
# 创建VLAN5和VLAN9,将GE0/0/2和GE0/0/3加入VLAN5,将GE0/0/4和GE0/0/5加入VLAN9。
[rt1]vlan 5
[rt1-vlan5]port g0/0/2
[rt1-vlan5]port g0/0/3
[rt1-vlan5]q
[rt1]vlan 9
[rt1-vlan9]port g0/0/4
[rt1-vlan9]port g0/0/5
[rt1-vlan9]q
# 配置交换式接口GigabitEthernetEth1/0/0为VLAN Trunk端口,允许VLAN 5、9通过。
[rt1]int g0/0/1
[rt1-GigabitEthernet0/0/1]port link-type trunk
[rt1-GigabitEthernet0/0/1]port trunk allow-pass vlan 5 9
[rt1-GigabitEthernet0/0/1]quit
步骤 1 配置RouterB
# 配置RouterB的接口GE0/0/1、GE0/0/2、GE0/0/3、GE0/0/4、GE0/0/5为交换式接口
[rt2]int g0/0/1
int g0/0/1
[rt2-GigabitEthernet0/0/1]portswitch
portswitch
[rt2-GigabitEthernet0/0/1]q[rt2-vlan5]port g0/0/2
port g0/0/2
[rt2-vlan5]port g0/0/3
port g0/0/3
[rt2-vlan5]q
q
[rt2]vlan 9
vlan 9
[rt2-vlan9]port g0/0/4
port g0/0/4
[rt2-vlan9]port g0/0/5
port g0/0/5
[rt2-vlan9]q
q
[rt2]int g0/0/1
int g0/0/1
[rt2-GigabitEthernet0/0/1]port link-type trunk
port link-type trunk
[rt2-GigabitEthernet0/0/1]port trunk allow-vlan 5 9
port trunk allow-vlan 5 9
rt2]dis port vlan
----------------------------------------------------------------
dis port vlan
Port Link Type PVID Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1 trunk 0 5 9
GigabitEthernet0/0/2 hybrid 5 -
GigabitEthernet0/0/3 hybrid 5 -
GigabitEthernet0/0/4 hybrid 9 -
GigabitEthernet0/0/5 hybrid 9 -
[rt2]dis port vlan g0/0/1
dis port vlan g0/0/1
Port Link Type PVID Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1 trunk 0 5 9