实现局域网内全部vlan互通,对路由进行负载负担,vlan有10,20,30,40,网关分别为:192.168.0.2,192.168.1.2,192.168.2.1,192.168.3.1,子网掩码都为255.255.255.0,网络拓扑图如下:
sysname SwitchA
vlan batch 10 20
#
int gi0/0/1
port link-type trunk
port trunk allow-pass vlan 10 40
quit
#
int gi0/0/2
port link-type trunk
port trunk allow-pass vlan 20 40
quit
#
interface gi0/0/3
port link-type access
port default vlan 40
#
interface vlanif 10
ip address 192.168.0.1 24
quit
inter vlanif 20
ip address 192.168.1.1 24
quit
interface Vlanif40
ip address 192.168.3.1 255.255.255.0
#
ospf 1 router-id 10.1.1.1
area 0
network 192.168.0.0 0.0.0.255
quit
area 1
network 192.168.1.0 0.0.0.255
quit
area 4
network 192.168.3.0 0.0.0.255
quit
quit
sysname SwitchB
vlan batch 10 20 30 40
#
int gi0/0/1
port link-type trunk
port trunk allow-pass vlan 10
quit
#
interface vlanif 10
ip address 192.168.0.2 24
quit
#
int vlanif 30
ip address 192.168.2.1 24
quit
ospf 1 router-id 10.2.2.2
area 0
network 192.168.0.0 0.0.0.255
area 3
network 192.168.2.0 0.0.0.255
quit
quit
#
sysname SwitchC
vlan batch 10 20 40
#
int gi0/0/1
port link-type trunk
port trunk allow-pass vlan 20
quit
#
interface gi0/0/9
port link-type access
port default vlan 20
#
interface gi0/0/10
port link-type access
port default vlan 40
#
inter vlanif 20
ip address 192.168.1.2 24
quit
ospf 1 router-id 10.3.3.3
area 1
network 192.168.1.0 0.0.0.255
quit
display ospf peer
所有终端互ping,全通,所有交换机互ping全通。
#
sysname SwitchA
#
vlan batch 10 20 40
#
interface Vlanif10
ip address 192.168.0.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.3.1 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 40
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20 40
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
#
ospf 1 router-id 10.1.1.1
area 0.0.0.0
network 192.168.0.0 0.0.0.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
area 0.0.0.4
network 192.168.3.0 0.0.0.255
#
#
sysname SwitchB
#
vlan batch 10 20 30 40
#
#
interface Vlanif10
ip address 192.168.0.2 255.255.255.0
#
interface Vlanif30
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 40
#
interface GigabitEthernet0/0/9
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/10
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/11
port link-type access
port default vlan 40
#
ospf 1 router-id 10.2.2.2
area 0.0.0.0
network 192.168.0.0 0.0.0.255
area 0.0.0.3
network 192.168.2.0 0.0.0.255
#
#
sysname SwitchC
#
vlan batch 10 20 40
#
interface Vlanif20
ip address 192.168.1.2 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 40
#
interface GigabitEthernet0/0/9
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/10
port link-type access
port default vlan 40
#
ospf 1 router-id 10.3.3.3
area 0.0.0.1
network 192.168.1.0 0.0.0.255
#