企业常用OSPF组网配置示例

转载至:企业常见ospf组网配置示例

企业常用OSPF组网配置示例

 

1、组网需求

 

         图1、企业常用ospf组网示例图(点击图片放大查看高清示例图)

如上图1要求各分公司与总公司之间用ospf连接。

由于特殊原因,新成立的分公司3无法与总公司直连,所以通过分公司2做vlink peer来实现与总公司的ospf连接。

 

2、配置思路

创建vlan把不同用户加入不同的vlan,实现二层隔离

总公司与分公司直连的连接采用trunk端口来实现通信

 

3、具体配置

具体配置以及配置命令的释义请参见ospf配置教程(ospf - 思唯网络学院博客)和vlan配置教程(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>

转载至:企业常见ospf组网配置示例

  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值