基于OSPF的简易网络结构部署

一、配置IP地址及缺省路由

AR1:

interface GigabitEthernet0/0/0

 ip address 10.1.61.1 255.255.255.0

interface GigabitEthernet0/0/1

 ip address 10.1.16.1 255.255.255.0

interface LoopBack0

 ip address 1.1.1.1 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 10.1.16.6

ip route-static 0.0.0.0 0.0.0.0 10.1.61.6

interface GigabitEthernet0/0/2

 ip address 192.168.1.1 255.255.255.0

AR2

 sysname r2

interface GigabitEthernet0/0/0

 ip address 10.1.26.2 255.255.255.0

interface LoopBack0

 ip address 2.2.2.2 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 10.1.26.6

AR3:

 sysname r3

interface GigabitEthernet0/0/0

 ip address 10.1.36.3 255.255.255.0

interface LoopBack0

 ip address 3.3.3.3 255.255.255.0

 AR4:

 sysname r4

interface GigabitEthernet0/0/0

 ip address 10.1.46.4 255.255.255.0

interface LoopBack0

 ip address 4.4.4.4 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 10.1.46.6

AR5:

 sysname r5

interface GigabitEthernet0/0/2

 ip address 10.1.56.5 255.255.255.0

interface LoopBack0

 ip address 5.5.5.5 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 10.1.56.6

AR6:

 sysname r6

interface GigabitEthernet0/0/0

 ip address 10.1.61.6 255.255.255.0

interface GigabitEthernet0/0/1

 ip address 10.1.16.6 255.255.255.0

interface GigabitEthernet0/0/2

 ip address 10.1.56.6 255.255.255.0

interface GigabitEthernet2/0/0

 ip address 10.1.36.6 255.255.255.0

interface GigabitEthernet3/0/0

 ip address 10.1.46.6 255.255.255.0

interface GigabitEthernet4/0/0

 ip address 10.1.26.6 255.255.255.0

interface LoopBack0

 ip address 6.6.6.6 255.255.255.0

二、配置MGRE

       其中R1,R2,R3为星型拓扑,R1,R4,R5为全MGRE拓扑

AR1:

interface Tunnel0/0/0

 ip address 10.1.1.1 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.16.1

 ospf network-type broadcast

 nhrp entry multicast dynamic

 nhrp network-id 100

interface Tunnel0/0/1

 ip address 20.1.1.1 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.61.1

 ospf network-type broadcast

 nhrp entry multicast dynamic

 nhrp network-id 200

AR2:

interface Tunnel0/0/0

 ip address 10.1.1.2 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.26.2

 ospf network-type broadcast

 ospf dr-priority 0

 nhrp network-id 100

 nhrp entry 10.1.1.1 10.1.16.1 register

AR3:

interface Tunnel0/0/0

 ip address 10.1.1.3 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.36.3

 ospf network-type broadcast

 ospf dr-priority 0

 nhrp network-id 100

 nhrp entry 10.1.1.1 10.1.16.1 register

AR4:

interface Tunnel0/0/0

 ip address 20.1.1.2 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.46.4

 ospf network-type broadcast

 nhrp network-id 200

 nhrp entry 20.1.1.1 10.1.61.1 register

 nhrp entry 20.1.1.3 10.1.56.5 register

AR5:

interface Tunnel0/0/0

 ip address 20.1.1.3 255.255.255.0

 tunnel-protocol gre p2mp

 source 10.1.56.5

 ospf network-type broadcast

 nhrp entry multicast dynamic

 nhrp network-id 200

 nhrp entry 20.1.1.1 10.1.61.1 register

三、配置OSPF

AR1:

ospf 1 router-id 1.1.1.1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.0

  network 10.1.1.1 0.0.0.0

  network 20.1.1.1 0.0.0.0

  network 192.168.1.0 0.0.0.255

AR2:

ospf 1 router-id 2.2.2.2

 area 0.0.0.0

  network 2.2.2.2 0.0.0.0

  network 10.1.1.2 0.0.0.0

  network 192.168.2.0 0.0.0.255

AR3:

ospf 1 router-id 3.3.3.3

 area 0.0.0.0

  network 3.3.3.3 0.0.0.0

  network 10.1.1.3 0.0.0.0

  network 192.168.3.0 0.0.0.255

AR4:

ospf 1 router-id 4.4.4.4

 area 0.0.0.0

  network 4.4.4.4 0.0.0.0

  network 20.1.1.2 0.0.0.0

  network 192.168.4.0 0.0.0.255

AR5:

ospf 1 router-id 5.5.5.5

 area 0.0.0.0

  network 5.5.5.5 0.0.0.0

  network 20.1.1.3 0.0.0.0

  network 192.168.5.0 0.0.0.255

四、修改tunnel隧道类型和优先级

由于OSPF在MGRE中默认连接方式为P2P,故在左边连接时,只能和其中一个邻居相连,所以只能和一个邻居处于FULL状态,此时,应该修改OSPF的连接方式,再修改完成后,由于DR和BDR之间的选取会混乱,之后再修改优先级。

[r1-Tunnel0/0/0]ospf network-type broadcast

[r2-Tunnel0/0/0]ospf network-type broadcast

[r3-Tunnel0/0/0]ospf network-type broadcast

 五、设置ACL 和 NAT 

[r2]acl 2000

[r2-acl-basic-2000]rule permit source any

[r2-acl-basic-2000]q

[r2]int g0/0/0

[r2-GigabitEthernet0/0/0]nat outbound 2000

六、测试

PC1:

 PC2:

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值