[R2]undo ip route-static 0.0.0.0 0 10.0.30.1
[R2]ip route-static 0.0.0.0 0 10.0.100.1
测试R1、R2和S1的Vlanif100接口之间的连通性。
![](http://imgq8.q578.com/ef/1115/9d60929d0e99c29d.jpg)
从ping命令的输出结果可知,R1、R2和S1的Vlanif 100接口可以互相通信。相比三层交换方案,VLAN聚合方案能够实现不同VLAN都使用相同的网关通信的功能,有效的减少IP地址的浪费和提高管理效率。但相对的,相同网段的计算机之间互访都依靠同一个Vlanif接口,也使这个接口的压力增大。
最终设备配置
[S1]display current-configuration
!Software Version V200R008C00SPC500
#
sysname S1
#
vlan batch 2 to 3 10 20 100
#
diffserv domain default
#
drop-profile default
#
vlan 100
aggregate-vlan
access-vlan 10 20
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif2
ip address 10.0.20.1 255.255.255.0
#
interface Vlanif3
ip address 10.0.30.1 255.255.255.0
#
interface Vlanif100
ip address 10.0.100.1 255.255.255.0
arp-proxy inter-sub-vlan-proxy enable
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
shutdown
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
port link-type trunk
port trunk allow-pass vlan 2 to 3 10 20
#
interface GigabitEthernet0/0/10
#
interface NULL0
#
user-interface con 0
authentication-mode password
set authentication password cipher $1a$fcjGHMtb0U$^GKZ+`,[email protected]$:T/P,R~iJ&')|!O":$b4)0*~&c-$
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
return
[S2]display current-configuration
!Software Version V200R008C00SPC500
#
sysname S2
#
vlan batch 2 to 3 10 20 100
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default