SwitchA的配置:
sysname switch A
#
vlan batch 10 40
#
interface Vlanif1
ip address dhcp-alloc
#
interface Vlanif10
ip address 1.1.4.2 255.255.255.0
#
interface Vlanif40
ip address 1.1.40.1 255.255.255.0
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ntdp enable
ndp enable
#
interface Ethernet0/0/4
port link-type access
port default vlan 40
ntdp enable
ndp enable
=================================================================================
switchA的路由表
[switch A]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Static 60 0 RD 1.1.4.1 Vlanif10
1.1.4.0/24 Direct 0 0 D 1.1.4.2 Vlanif10
1.1.4.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
1.1.40.0/24 Direct 0 0 D 1.1.40.1 Vlanif40
1.1.40.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
switchB的配置:
sysname switch B
#
vlan batch 10 30
#
interface Vlanif1
ip address dhcp-alloc
#
interface Vlanif10
ip address 1.1.4.1 255.255.255.0
#
interface Vlanif30
ip address 1.1.1.1 255.255.255.0
#
interface Ethernet0/0/1
port link-type access
port default vlan 30
ntdp enable
ndp enable
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ntdp enable
ndp enable
============================================================================
switchB的路由表
[switch B]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 Vlanif30
1.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
1.1.4.0/24 Direct 0 0 D 1.1.4.1 Vlanif10
1.1.4.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0