
企业常用OSPF组网配置示例
1、组网需求
图1、企业常用ospf组网示例图(点击图片放大查看高清示例图)
如上图1要求各分公司与总公司之间用ospf连接。
由于特殊原因,新成立的分公司3无法与总公司直连,所以通过分公司2做vlink peer来实现与总公司的ospf连接。
2、配置思路
创建vlan把不同用户加入不同的vlan,实现二层隔离
总公司与分公司直连的连接采用trunk端口来实现通信
3、具体配置
具体配置以及配置命令的释义请参见ospf配置教程(http://www.023wg.com/tag/ospf)和vlan配置教程(http://www.023wg.com/tag/vlan)
4、配置文件
4.1、LSW5配置文件
<lsw5>dis cu
#
sysname lsw5
#
vlan batch 50
#
interface Vlanif1
#
interface Vlanif50
ip
address 172.16.50.254 255.255.255.0
#
interface GigabitEthernet0/0/2
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.1
network 172.16.50.0 0.0.0.255
stub
#
return
<lsw5>
4.2、LSW6配置文件
<lsw6>dis cu
#
sysname lsw6
#
vlan batch 60
#
interface Vlanif1
#
interface Vlanif60
ip
address 172.16.60.254 255.255.255.0
ospf
dr-priority 2
#
#
interface GigabitEthernet0/0/2
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.1
network 172.16.60.0 0.0.0.255
stub
#
return
<lsw6>
4.3、LSW3配置文件
<lsw3>dis cu
#
sysname lsw3
#
vlan batch 10 50 60 200
#
interface Vlanif1
#
interface Vlanif10
ip
address 172.16.10.254 255.255.255.0
#
interface Vlanif50
ip
address 172.16.50.1 255.255.255.0
#
interface Vlanif60
ip
address 172.16.60.1 255.255.255.0
ospf
dr-priority 200
#
interface Vlanif200
ip
address 10.155.200.1 255.255.255.0
#
interface GigabitEthernet0/0/2
port
link-type access
port
default vlan 10
#
interface GigabitEthernet0/0/12
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/13
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/24
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.0
network 10.155.200.0 0.0.0.255
area
0.0.0.1
network 172.16.10.0 0.0.0.255
network 172.16.50.0 0.0.0.255
network 172.16.60.0 0.0.0.255
stub
#
user-interface con 0
user-interface vty 0 4
#
return
<lsw3>
4.4、LSW1配置文件
<lsw1>dis cu
#
sysname lsw1
#
vlan batch 100 200 to 201
#
interface Vlanif1
#
interface Vlanif100
ip
address 10.155.100.254 255.255.255.0
#
interface Vlanif200
ip
address 10.155.200.254 255.255.255.0
#
interface Vlanif201
ip
address 10.155.201.254 255.255.255.0
#
interface GigabitEthernet0/0/2
port
link-type access
port
default vlan 100
#
interface GigabitEthernet0/0/23
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/24
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.0
network 10.155.100.0 0.0.0.255
network 10.155.200.0 0.0.0.255
network 10.155.201.0 0.0.0.255
#
return
<lsw1>
4.5、LSW4配置文件
<lsw4>dis cu
#
sysname lsw4
#
vlan batch 20 30 201
#
interface Vlanif1
#
interface Vlanif20
ip
address 192.168.20.254 255.255.255.0
#
interface Vlanif30
ip
address 192.168.30.1 255.255.255.0
#
interface Vlanif201
ip
address 10.155.201.1 255.255.255.0
#
interface GigabitEthernet0/0/2
port
link-type access
port
default vlan 20
#
interface GigabitEthernet0/0/12
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/23
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
ospf 1
area
0.0.0.0
network 10.155.201.0 0.0.0.255
area
0.0.0.2
network 192.168.20.0 0.0.0.255
network 192.168.30.0 0.0.0.255
vlink-peer 192.168.30.254
#
return
<lsw4>
4.6、LSW9配置文件
<lsw9>dis cu
#
sysname lsw9
#
vlan batch 30 60
#
interface Vlanif1
#
interface Vlanif30
ip
address 192.168.30.254 255.255.255.0
#
interface Vlanif60
ip
address 192.168.60.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.2
network 192.168.30.0 0.0.0.255
vlink-peer 192.168.20.254
area
0.0.0.3
network 192.168.60.0 0.0.0.255
#
return
<lsw9
4.7、LSW10P配置文件
<lsw10>dis cu
#
sysname lsw10
#
vlan batch 60
#
interface Vlanif1
#
interface Vlanif60
ip
address 192.168.60.254 255.255.255.0
#
interface GigabitEthernet0/0/2
port
link-type trunk
port
trunk allow-pass vlan 2 to 4094
#
interface NULL0
#
ospf 1
area
0.0.0.3
network 192.168.60.0 0.0.0.255
#
return
<lsw10>
5、配置文件下载
见下方



本文地址:http://www.023wg.com/lypz/127.html
版权声明:若无注明,本文皆为“Swiers思唯网络博客”原创,转载请保留文章出处。

