MPLS 实验

1 配置底层IP

r1
inter g0/0/0
ip ad 192.168.2.1 24
inter lo0
ip ad 192.168.1.1 24

r2
inter g0/0/1
ip ad 23.1.1.2 24
inter lo0
ip ad 2.2.2.2 24

r3
inter g0/0/0
ip ad 23.1.1.3 24
inter g0/0/1
ip ad 34.1.1.3 24
inter lo0
ip ad 3.3.3.3 24

r4
inter g0/0/0
ip ad 34.1.1.4 24
inter lo0
ip ad 4.4.4.4 24

r5
inter g0/0/0
ip ad 192.168.3.1 24
inter lo0
ip ad 192.168.4.1 24

r6
inter g0/0/0
ip ad 192.168.2.1 24
inter lo0
ip ad 192.168.1.2 24

r7
inter g0/0/0
ip ad 192.168.3.1 24
inter lo0
ip ad 192.168.4.2 24

r2
ospf 1 router-id 2.2.2.2
area 0
network 23.1.1.0 0.0.0.255
network 2.2.2.0 0.0.0.255

r3
ospf 1 router-id 3.3.3.3
area 0
network 23.1.1.0 0.0.0.255
network 34.1.1.0 0.0.0.255
network 3.3.3.0 0.0.0.255

r4
ospf 1 router-id 4.4.4.4
area 0
network 34.1.1.0 0.0.0.255
network 4.4.4.0 0.0.0.255
2 配置MPLS

r2
mpls lsr-id 2.2.2.2
mpls
mpls ldp
q
interface GigabitEthernet 0/0/1
mpls
mpls ldp

r3
mpls lsr-id 3.3.3.3
mpls
mpls ldp
q
interface GigabitEthernet 0/0/0
mpls
mpls ldp

interface GigabitEthernet 0/0/1
mpls
mpls ldp

r4
mpls lsr-id 4.4.4.4
mpls
mpls ldp
q
interface GigabitEthernet 0/0/0
mpls
mpls ldp


r2
ip vpn-instance a 
route-distinguisher 1:1 
vpn-target 1:1 
interface GigabitEthernet 0/0/0 
ip binding vpn-instance a 
ip address 192.168.2.2 24 

ip vpn-instance b
route-distinguisher 2:2
vpn-target 2:2
interface GigabitEthernet 0/0/2
ip binding vpn-instance b
ip address 192.168.2.2 24

r4
ip vpn-instance a
route-distinguisher 1:1
vpn-target 1:1
interface GigabitEthernet 0/0/1
ip binding vpn-instance a
ip address 192.168.3.2 24

ip vpn-instance b
route-distinguisher 2:2
vpn-target 2:2
interface GigabitEthernet 0/0/2
ip binding vpn-instance b
ip address 192.168.3.2 24
3 配置动态路由

r1
ospf 2
area 0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255

r2
ospf 2 vpn-instance a
area 0
network 192.168.2.0 0.0.0.255

r6
ospf 3
area 0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255

r2
ospf 3 vpn-instance b
area 0
network 192.168.2.0 0.0.0.255

r5
ospf 2
area 0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255

r4
ospf 2 vpn-instance a
area 0
network 192.168.3.0 0.0.0.255

r7
ospf 3
area 0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255

r4
ospf 3 vpn-instance b
area 0
network 192.168.3.0 0.0.0.255

4 配置BGP

r2
bgp 1
peer 4.4.4.4 as-number 1
peer 4.4.4.4 connect-interface lo0
ipv4-family vpnv4
peer 4.4.4.4 enable

r4
bgp 1
peer 2.2.2.2 as-number 1
peer 2.2.2.2 connect-interface lo0
ipv4-family vpnv4
peer 2.2.2.2 enable


r2
bgp 1
ipv4-family vpn-instance a
import-route ospf 2
ipv4-family vpn-instance b
import-route ospf 3
q
ospf 2
import-route bgp
ospf 3
import-route bgp

r4
bgp 1
ipv4-family vpn-instance a
import-route ospf 2
ipv4-family vpn-instance b
import-route ospf 3
q
ospf 2
import-route bgp
ospf 3
import-route bgp

5 配置公网地址

r4
inter g4/0/0
ip ad 100.1.1.1 24

r7
inter g0/0/1
ip ad 100.1.1.2 24

acl 2000
rule permit source any
q
inter g0/0/1
nat outbound 2000
q


r7
ospf 3
default-route-advertise always
q
ip route-static 0.0.0.0 0 100.1.1.1

6 测试


 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值