【实验】MPLS+DHCP+CHAP+Spoke的数据要经过Hub

根据网友南乔木投稿的拓扑和需求,主页菌也做了该实验——【实验】MPLS+DHCP+CHAP+Spoke的数据要经过Hub(感谢南乔木投稿)

【实验】MPLS+DHCP+CHAP+Spoke的数据要经过Hub
【实验】MPLS+DHCP+CHAP+Spoke的数据要经过Hub

实验需求:

  • IP地址按拓扑给出的配置,其中IOU1需通过DHCP获得地址10.123.1.100,IOU4为DHCP下发地址,中间区域的IP由12.34.56.0/24网段划分成30子网IP地址。
  • 中间区域为MPLS区域
  • 要求左上方区域去往左下方区域,路径为:IOU1->IOU6->IOU8->IOU10->IOU13->IOU10->IOU8->IOU7->IOU18->IOU19

以下是所有的配置:

1、左上角的矩形区域:

IOU1:

! 地址规划
conf t
int l 0
ip add 1.1.1.1 255.255.255.255

int e 0/0
ip add dhcp
no sh

!IGP
router eigrp 100
no au
net 0.0.0.0 0.0.0.0

IOU2:

! 地址规划
conf t
int l 0
ip add 2.2.2.2 255.255.255.255

int e 0/1
ip add 10.123.1.2 255.255.255.0
no sh

int e 0/2
ip add 10.14.4.2 255.255.255.0
no sh

!IGP
router eigrp 100
no au
net 0.0.0.0 0.0.0.0

! DHCP
int e 0/1
ip helper-address 10.14.4.4

IOU16:

!vlan划分
conf t
int r e 0/0-2
sw mo ac
sw ac v 123

IOU17:

!vlan划分
conf t
int r e 0/0-2
sw mo ac
sw ac v 234

IOU3:

! 地址规划
conf t
int l 0
ip add 3.3.3.3 255.255.255.255

int e 0/1
ip add 10.14.4.3 255.255.255.0
no sh

int e 0/2
ip add 10.123.1.3 255.255.255.0
no sh

!IGP
router eigrp 100
no au
net 0.0.0.0 0.0.0.0

! DHCP
int e 0/2
ip helper-address 10.14.4.4

IOU4:

! 地址规划
conf t
int l 0
ip add 4.4.4.4 255.255.255.255

int e 0/0
ip add 10.14.4.4 255.255.255.0
no sh

int s 2/0
ip add 45.1.1.4 255.255.255.0
no sh

!IGP
router eigrp 100
no au
net 0.0.0.0 0.0.0.0

!EIGRP认证
key chain HTPC
key 1
key-string HTPC.HK

int s 2/0
ip authentication mode eigrp 100 md5
ip authentication key-chain eigrp 100 HTPC

! DHCP
ip dhcp excluded-address 10.123.1.2 10.123.1.3
ip dhcp pool HTPC
network 10.123.1.0 255.255.255.0

IOU5:

! 地址规划
conf t
int l 0
ip add 5.5.5.5 255.255.255.255

int s 2/0
ip add 45.1.1.5 255.255.255.0
no sh

int s 2/1
ip add 56.1.1.5 255.255.255.0
no sh

!IGP
router eigrp 100
no au
net 0.0.0.0 0.0.0.0

!EIGRP认证
key chain HTPC
key 1
key-string HTPC.HK

int s 2/0
ip authentication mode eigrp 100 md5
ip authentication key-chain eigrp 100 HTPC
int s 2/1
ip authentication mode eigrp 100 md5
ip authentication key-chain eigrp 100 HTPC

2、中间圆形的MPLS区域:

IOU6:

!地址规划
conf t
int l 0
ip add 6.6.6.6 255.255.255.255

int e 0/0
ip add 12.34.56.1 255.255.255.252
no sh

int e 0/1
ip add 12.34.56.5 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 6.6.6.6
mpls ldp autoconfig

int r e 0/0-1 , l 0
ip os 1 a 0

!VRF
ip vrf 100
rd 1:100
route-target export 1:100
route-target import 1:200

int s 2/1
ip vrf f 100
ip add 56.1.1.6 255.255.255.0
no sh

!PE-CE IGP
router eigrp 100
add ipv4 vrf 100 au 100
net 56.1.1.6 0.0.0.0

!EIGRP认证
key chain HTPC
key 1
key-string HTPC.HK

int s 2/1
ip authentication mode eigrp 100 md5
ip authentication key-chain eigrp 100 HTPC

!MP-BGP
router bgp 1
bgp router-id 6.6.6.6
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 8.8.8.8 remote-as 1
neighbor 8.8.8.8 up l 0
neighbor 9.9.9.9 remote-as 1
neighbor 9.9.9.9 up l 0

address-family vpnv4
neighbor 8.8.8.8 activate
neighbor 9.9.9.9 activate

!双向重分布
router eigrp 100
add ipv4 vrf 100 au 100
red bgp 1 me 10000 10 255 1 1500

router bgp 1
add ipv4 vrf 100
red eigrp 100

IOU8:

!地址规划
conf t
int l 0
ip add 8.8.8.8 255.255.255.255

int e 0/0
ip add 12.34.56.2 255.255.255.252
no sh

int e 0/1
ip add 12.34.56.17 255.255.255.252
no sh

int e 0/2
ip add 12.34.56.9 255.255.255.252
no sh

int e 0/3
ip add 12.34.56.21 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 8.8.8.8
mpls ldp autoconfig

int r e 0/0-3 , l 0
ip os 1 a 0

!MP-BGP
router bgp 1
bgp router-id 8.8.8.8
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor iBGP peer-group
neighbor iBGP remote-as 1
neighbor iBGP up l 0
neighbor 6.6.6.6 peer-group iBGP
neighbor 7.7.7.7 peer-group iBGP
neighbor 10.10.10.10 peer-group iBGP
neighbor 11.11.11.11 peer-group iBGP

address-family vpnv4
neighbor iBGP route-reflector-client
neighbor 6.6.6.6 activate
neighbor 7.7.7.7 activate
neighbor 10.10.10.10 activate
neighbor 11.11.11.11 activate

IOU7:

!地址规划
conf t
int l 0
ip add 7.7.7.7 255.255.255.255

int e 0/0
ip add 12.34.56.26 255.255.255.252
no sh

int e 0/1
ip add 12.34.56.18 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 7.7.7.7
mpls ldp autoconfig

int r e 0/0-1 , l 0
ip os 1 a 0

!VRF and PE-CE IGP and CHAP
ip vrf 300
rd 1:300
route-target export 1:300
route-target import 1:200

int s 2/0
ip vrf f 300
ip add 192.18.10.7 255.255.255.0
en ppp
no sh
ip os 300 a 100

!MP-BGP
router bgp 1
bgp router-id 7.7.7.7
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 8.8.8.8 remote-as 1
neighbor 8.8.8.8 up l 0
neighbor 9.9.9.9 remote-as 1
neighbor 9.9.9.9 up l 0

address-family vpnv4
neighbor 8.8.8.8 activate
neighbor 9.9.9.9 activate

!双向重分布
router ospf 300 vrf 300
red bgp 1 subnets

router bgp 1
add ipv4 vrf 300
red ospf 300

!OSPF向CE下发默认路由
router os 300 vrf 300
default-information originate

IOU10:

!地址规划
conf t
int l 0
ip add 10.10.10.10 255.255.255.255

int e 0/2
ip add 12.34.56.10 255.255.255.252
no sh

int e 0/3
ip add 12.34.56.14 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 10.10.10.10
mpls ldp autoconfig

int r e 0/2-3 , l 0
ip os 1 a 0

!VRF and PE-CE IGP
ip vrf 200
rd 1:200
route-target export 1:200
route-target import 1:100
route-target import 1:300

int e 0/0
ip vrf f 200
ip add 172.10.10.10 255.255.255.0
no sh
ip os 200 a 1

!MP-BGP
router bgp 1
bgp router-id 10.10.10.10
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 8.8.8.8 remote-as 1
neighbor 8.8.8.8 up l 0
neighbor 9.9.9.9 remote-as 1
neighbor 9.9.9.9 up l 0

address-family vpnv4
neighbor 8.8.8.8 activate
neighbor 9.9.9.9 activate

!双向重分布
router ospf 200 vrf 200
red bgp 1 subnets

router bgp 1
add ipv4 vrf 200
red ospf 200

!BGP通告0.0.0.0
router bgp 1
add ipv4 vrf 200
net 0.0.0.0

IOU9:

!地址规划
conf t
int l 0
ip add 9.9.9.9 255.255.255.255

int e 0/0
ip add 12.34.56.25 255.255.255.252
no sh

int e 0/1
ip add 12.34.56.6 255.255.255.252
no sh

int e 0/2
ip add 12.34.56.29 255.255.255.252
no sh

int e 0/3
ip add 12.34.56.13 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 9.9.9.9
mpls ldp autoconfig

int r e 0/0-3 , l 0
ip os 1 a 0

!MP-BGP
router bgp 1
bgp router-id 9.9.9.9
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor iBGP peer-group
neighbor iBGP remote-as 1
neighbor iBGP up l 0
neighbor 6.6.6.6 peer-group iBGP
neighbor 7.7.7.7 peer-group iBGP
neighbor 10.10.10.10 peer-group iBGP
neighbor 11.11.11.11 peer-group iBGP

address-family vpnv4
neighbor iBGP route-reflector-client
neighbor 6.6.6.6 activate
neighbor 7.7.7.7 activate
neighbor 10.10.10.10 activate
neighbor 11.11.11.11 activate

IOU11:

!地址规划
conf t
int l 0
ip add 11.11.11.11 255.255.255.255

int e 0/2
ip add 12.34.56.30 255.255.255.252
no sh

int e 0/3
ip add 12.34.56.22 255.255.255.252
no sh

!IGP and MPLS
router os 1
router-id 11.11.11.11
mpls ldp autoconfig

int r e 0/2-3 , l 0
ip os 1 a 0

!VRF and PE-CE IGP
ip vrf 200
rd 1:200
route-target export 1:200
route-target import 1:100
route-target import 1:300

int e 0/0
ip vrf f 200
ip add 172.12.10.11 255.255.255.0
no sh
ip os 200 a 1

!MP-BGP
router bgp 1
bgp router-id 11.11.11.11
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 8.8.8.8 remote-as 1
neighbor 8.8.8.8 up l 0
neighbor 9.9.9.9 remote-as 1
neighbor 9.9.9.9 up l 0

address-family vpnv4
neighbor 8.8.8.8 activate
neighbor 9.9.9.9 activate

!双向重分布
router ospf 200 vrf 200
red bgp 1 subnets

router bgp 1
add ipv4 vrf 200
red ospf 200

3、左下角圆形区域:

IOU18:

!地址规划
conf t
int l 0
ip add 18.18.18.18 255.255.255.255

int s 2/0
ip add 192.18.10.18 255.255.255.0
no sh

int e 0/0
ip add 192.19.10.18 255.255.255.0
no sh

!IGP
router os 300
router-id 18.18.18.18
net 0.0.0.0 0.0.0.0 a 100

!CHAP
int s 2/0
encapsulation ppp
ppp chap hostname IOU7
ppp chap password 0 IOU7

IOU19:

!地址规划
conf t
int l 0
ip add 19.19.19.19 255.255.255.255

int e 0/0
ip add 192.19.10.19 255.255.255.0
no sh

!IGP
router os 300
router-id 19.19.19.19
net 0.0.0.0 0.0.0.0 a 100

4、右下角矩形区域:

IOU12:

!地址规划
conf t
int l 0
ip add 12.12.12.12 255.255.255.255

int e 0/0
ip add 172.12.10.12 255.255.255.0
no sh

int e 0/1
ip add 172.13.10.12 255.255.255.0
no sh

int e 0/2
ip add 172.14.10.12 255.255.255.0
no sh

int e 0/3
ip add 172.14.20.12 255.255.255.0
no sh

!IGP
router os 200
router-id 12.12.12.12
net 0.0.0.0 0.0.0.0 a 1

IOU13:

!地址规划
conf t
int l 0
ip add 13.13.13.13 255.255.255.255

int e 0/0
ip add 172.10.10.13 255.255.255.0
no sh

int e 0/1
ip add 172.13.10.13 255.255.255.0
no sh

int e 0/2
ip add 172.11.10.13 255.255.255.0
no sh

int e 0/3
ip add 172.14.20.13 255.255.255.0
no sh

!IGP
router os 200
router-id 13.13.13.13
net 0.0.0.0 0.0.0.0 a 1

!下发默认路由
router os 200
default-information originate always

IOU14:

!地址规划
conf t
int l 0
ip add 14.14.14.14 255.255.255.255

int e 0/2
ip add 172.14.10.14 255.255.255.0
no sh

int e 0/3
ip add 172.15.20.14 255.255.255.0
no sh

!IGP
router os 200
router-id 14.14.14.14
net 0.0.0.0 0.0.0.0 a 1

IOU15:

!地址规划
conf t
int l 0
ip add 15.15.15.15 255.255.255.255

int e 0/2
ip add 172.11.10.15 255.255.255.0
no sh

int e 0/3
ip add 172.14.20.15 255.255.255.0
no sh

!IGP
router os 200
router-id 15.15.15.15
net 0.0.0.0 0.0.0.0 a 1

实验现象:

DHCP:

IOU4#sh ip dhcp binding 
 Bindings from all pools not associated with VRF:
 IP address          Client-ID/              Lease expiration        Type
                     Hardware address/
                     User name
 10.123.1.1          0063.6973.636f.2d61.    Apr 04 2016 08:24 AM    Automatic
                     6162.622e.6363.3030.
                     2e30.3130.302d.4574.
                     302f.30

选路:

IOU1#tra 19.19.19.19 so l 0
 Type escape sequence to abort.
 Tracing the route to 19.19.19.19
 VRF info: (vrf in name/id, vrf out name/id)
   1 10.123.1.2 2 msec
     10.123.1.3 5 msec
     10.123.1.2 1 msec
   2 10.14.4.4 1 msec 1 msec 1 msec
   3 45.1.1.5 9 msec 10 msec 10 msec
   4 56.1.1.6 16 msec 19 msec 21 msec
   5 12.34.56.6 [MPLS: Labels 22/38 Exp 0] 26 msec 19 msec 19 msec
   6 172.10.10.10 [MPLS: Label 38 Exp 0] 23 msec 22 msec 22 msec
   7 172.10.10.13 19 msec 20 msec 24 msec
   8 172.10.10.10 33 msec 20 msec 19 msec
   9 12.34.56.9 [MPLS: Labels 24/28 Exp 0] 29 msec 37 msec 27 msec
 10 192.18.10.7 [MPLS: Label 28 Exp 0] 18 msec 21 msec 27 msec
 11 192.18.10.18 27 msec 31 msec 37 msec
 12 192.19.10.19 28 msec 44 msec 27 msec

还有就是在这个环境下BGP是可以不用配置next-hop-self的;然后我的做法是把IOU8和IOU9做成了RR,IOU6/7/10/11跟RR建邻居。

 

其他文章:【实验】MPLS+DHCP+CHAP+Spoke的数据要经过Hub(网友南乔木投稿)

打赏作者
这里是 “ CCIE 工程师社区 ” 官方的捐款通道,您是否可以考虑请我们喝杯咖啡呢?

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

[支付宝] 扫描二维码打赏

Was this article helpful?

Related Articles

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.