企业常见ospf组网配置示例
首页 > HuaWei > 路由配置   作者:杭州清默网络  2016年1月17日 13:12 星期日  字号:   评论:0 条
时间:2016-1-17 13:12   评论:0 条 


企业常用OSPF组网配置示例

 

1、组网需求

 ospf基本组网示例图.png

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

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

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

 

2、配置思路

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

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

 

3、具体配置

具体配置以及配置命令的释义请参见ospf配置教程(http://www.023wg.com/tag/ospf)和vlan配置教程(http://www.023wg.com/tag/vlan

 

4、配置文件

4.1LSW5配置文件

<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.2LSW6配置文件

<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.3LSW3配置文件

<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.4LSW1配置文件

<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.5LSW4配置文件

<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.6LSW9配置文件

<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.7LSW10P配置文件

<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、配置文件下载

见下方

 您阅读这篇文章共花了: 
二维码加载中...
技术交流:欢迎在本文下方留言或加入QQ群:647682417 互相学习。     
本文地址:http://www.023wg.com/lypz/127.html
版权声明:若无注明,本文皆为“杭州清默网络”原创,转载请保留文章出处。

返回顶部    首页   
版权所有:杭州清默网络    杭州清默网络