学习目标
1、掌握vlan的配置
2、掌握eth-trunk使用
3、掌握OSPF具体应用
4、理解trunk允许vlan1通过
5、理解vlan跨交互机实现同一个vlan的访问
注释:
1、转换思维,把两台三层交换机当成路由器去想,比如两台路由器需要直连网段200.1.1.0/24,把直连网段宣告到OSPF里面,实现邻居的建立,在这个拓扑中,能把VLAN1使用起来配置成直连接口。
2、三成交换机的优势,既能实现二层的所有功能,又能实现路由器的功能。
网络拓扑图
配置
交换机一(LSW2):
sysname sw1
vlan batch 2 to 3
interface Vlanif1
ip address 200.1.1.1 255.255.255.0
interface Vlanif2
ip address 192.168.2.254 255.255.255.0
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
interface GigabitEthernet0/0/1
eth-trunk 1
interface GigabitEthernet0/0/2
eth-trunk 1
interface GigabitEthernet0/0/3
port link-type access
port default vlan 2
interface GigabitEthernet0/0/4
port link-type access
port default vlan 3
ospf 1 router-id 1.1.1.1
retransmission-limit
area 0.0.0.0
network 200.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
交换机一(LSW3):
sysname sw2
vlan batch 2 to 3
interface Vlanif1
ip address 200.1.1.2 255.255.255.0
interface Vlanif3
ip address 192.168.3.254 255.255.255.0
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
interface GigabitEthernet0/0/1
eth-trunk 1
interface GigabitEthernet0/0/2
eth-trunk 1
interface GigabitEthernet0/0/3
port link-type access
port default vlan 2
interface GigabitEthernet0/0/4
port link-type access
port default vlan 3