最佳答案
· CE 1、CE 3属于VPN 1,CE 2、CE 4属于VPN 2;
· VPN 1使用的Route Target属性为111:1,VPN 2使用的Route Target属性为222:2。不同VPN用户之间不能互相访问;
· CE与PE之间配置EBGP交换VPN路由信息;
· PE与PE之间配置OSPF实现PE内部的互通、配置MP-IBGP交换VPN路由信息。
设备 | 接口 | IP地址 | 设备 | 接口 | IP地址 |
CE 1 | GE1/0/1 | 10.1.1.1/24 | P | Loop0 | 2.2.2.9/32 |
PE 1 | Loop0 | 1.1.1.9/32 |
| GE1/0/4 | 172.1.1.2/24 |
| GE1/0/1 | 10.1.1.2/24 |
| GE1/0/5 | 172.2.1.1/24 |
| GE1/0/2 | 10.2.1.2/24 | PE 2 | Loop0 | 3.3.3.9/32 |
| GE1/0/4 | 172.1.1.1/24 |
| GE1/0/1 | 10.3.1.2/24 |
CE 2 | GE1/0/1 | 10.2.1.1/24 |
| GE1/0/2 | 10.4.1.2/24 |
CE 3 | GE1/0/1 | 10.3.1.1/24 |
| GE1/0/4 | 172.2.1.2/24 |
CE 4 | GE1/0/1 | 10.4.1.1/24 |
|
|
|
(1) 在MPLS骨干网上配置IGP协议,实现骨干网PE和P的互通
# 配置PE 1。
<PE1> system-view
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 1.1.1.9 32
[PE1-LoopBack0] quit
[PE1] interface gigabitethernet 1/0/4
[PE1-GigabitEthernet1/0/4] ip address 172.1.1.1 24
[PE1-GigabitEthernet1/0/4] quit
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 配置P。
<P> system-view
[P] interface loopback 0
[P-LoopBack0] ip address 2.2.2.9 32
[P-LoopBack0] quit
[P] interface gigabitethernet 1/0/4
[P-GigabitEthernet1/0/4] ip address 172.1.1.2 24
[P-GigabitEthernet1/0/4] quit
[P] interface gigabitethernet 1/0/5
[P-GigabitEthernet1/0/5] ip address 172.2.1.1 24
[P-GigabitEthernet1/0/5] quit
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# 配置PE 2。
<PE2> system-view
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 3.3.3.9 32
[PE2-LoopBack0] quit
[PE2] interface gigabitethernet 1/0/4
[PE2-GigabitEthernet1/0/4] ip address 172.2.1.2 24
[PE2-GigabitEthernet1/0/4] quit
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
配置完成后,PE 1、P、PE 2之间应能建立OSPF邻居,执行display ospf peer命令可以看到邻居达到FULL状态。执行display ip routing-table命令可以看到PE之间学习到对方的Loopback路由。
(2) 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP
# 配置PE 1。
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls ldp
[PE1-ldp] quit
[PE1] interface gigabitethernet 1/0/4
[PE1-GigabitEthernet1/0/4] mpls enable
[PE1-GigabitEthernet1/0/4] mpls ldp enable
[PE1-GigabitEthernet1/0/4] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9
[P] mpls ldp
[P-ldp] quit
[P] interface gigabitethernet 1/0/4
[P-GigabitEthernet1/0/4] mpls enable
[P-GigabitEthernet1/0/4] mpls ldp enable
[P-GigabitEthernet1/0/4] quit
[P] interface gigabitethernet 1/0/5
[P-GigabitEthernet1/0/5] mpls enable
[P-GigabitEthernet1/0/5] mpls ldp enable
[P-GigabitEthernet1/0/5] quit
# 配置PE 2。
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls ldp
[PE2-ldp] quit
[PE2] interface gigabitethernet 1/0/4
[PE2-GigabitEthernet1/0/4] mpls enable
[PE2-GigabitEthernet1/0/4] mpls ldp enable
[PE2-GigabitEthernet1/0/4] quit
上述配置完成后,PE 1、P、PE 2之间应能建立LDP会话,执行display mpls ldp peer命令可以看到LDP会话的状态为Operational。执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。
(3) 在PE设备上配置VPN实例,将CE接入PE
# 配置PE 1。
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] route-distinguisher 100:1
[PE1-vpn-instance-vpn1] vpn-target 111:1
[PE1-vpn-instance-vpn1] quit
[PE1] ip vpn-instance vpn2
[PE1-vpn-instance-vpn2] route-distinguisher 100:2
[PE1-vpn-instance-vpn2] vpn-target 222:2
[PE1-vpn-instance-vpn2] quit
[PE1] interface gigabitethernet 1/0/1
[PE1-GigabitEthernet1/0/1] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/1] ip address 10.1.1.2 24
[PE1-GigabitEthernet1/0/1] quit
[PE1] interface gigabitethernet 1/0/2
[PE1-GigabitEthernet1/0/2] ip binding vpn-instance vpn2
[PE1-GigabitEthernet1/0/2] ip address 10.2.1.2 24
[PE1-GigabitEthernet1/0/2] quit
# 配置PE 2。
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] route-distinguisher 200:1
[PE2-vpn-instance-vpn1] vpn-target 111:1
[PE2-vpn-instance-vpn1] quit
[PE2] ip vpn-instance vpn2
[PE2-vpn-instance-vpn2] route-distinguisher 200:2
[PE2-vpn-instance-vpn2] vpn-target 222:2
[PE2-vpn-instance-vpn2] quit
[PE2] interface gigabitethernet 1/0/1
[PE2-GigabitEthernet1/0/1] ip binding vpn-instance vpn1
[PE2-GigabitEthernet1/0/1] ip address 10.3.1.2 24
[PE2-GigabitEthernet1/0/1] quit
[PE2] interface gigabitethernet 1/0/2
[PE2-GigabitEthernet1/0/2] ip binding vpn-instance vpn2
[PE2-GigabitEthernet1/0/2] ip address 10.4.1.2 24
[PE2-GigabitEthernet1/0/2] quit
# 按图1-25配置各CE的接口IP地址,配置过程略。
配置完成后,在PE设备上执行display ip vpn-instance命令可以看到VPN实例的配置情况。各PE能ping通自己接入的CE。
以PE 1和CE 1为例:
[PE1] display ip vpn-instance
Total VPN-Instances configured : 2
VPN-Instance Name RD Create time
vpn1 100:1 2012/02/13 12:49:08
vpn2 100:2 2012/02/13 12:49:20
[PE1] ping -vpn-instance vpn1 10.1.1.1
Ping 10.1.1.1 (10.1.1.1): 56 data bytes, press CTRL_C to break
56 bytes from 10.1.1.1: icmp_seq=0 ttl=255 time=1.000 ms
56 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=2.000 ms
56 bytes from 10.1.1.1: icmp_seq=2 ttl=255 time=0.000 ms
56 bytes from 10.1.1.1: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 10.1.1.1: icmp_seq=4 ttl=255 time=0.000 ms
--- Ping statistics for 10.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.000/0.800/2.000/0.748 ms
(4) 在PE与CE之间建立EBGP对等体,引入VPN路由
# 配置CE 1。
<CE1> system-view
[CE1] bgp 65410
[CE1-bgp-default] peer 10.1.1.2 as-number 100
[CE1-bgp-default] address-family ipv4 unicast
[CE1-bgp-default-ipv4] peer 10.1.1.2 enable
[CE1-bgp-default-ipv4] import-route direct
[CE1-bgp-default-ipv4] quit
[CE1-bgp-default] quit
# 另外3个CE设备(CE 2~CE 4)配置与CE 1设备配置类似,配置过程省略。
# 配置PE 1。
[PE1] bgp 100
[PE1-bgp-default] ip vpn-instance vpn1
[PE1-bgp-default-vpn1] peer 10.1.1.1 as-number 65410
[PE1-bgp-default-vpn1] address-family ipv4 unicast
[PE1-bgp-default-ipv4-vpn1] peer 10.1.1.1 enable
[PE1-bgp-default-ipv4-vpn1] quit
[PE1-bgp-default-vpn1] quit
[PE1-bgp-default] ip vpn-instance vpn2
[PE1-bgp-default-vpn2] peer 10.2.1.1 as-number 65420
[PE1-bgp-default-vpn2] address-family ipv4 unicast
[PE1-bgp-default-ipv4-vpn2] peer 10.2.1.1 enable
[PE1-bgp-default-ipv4-vpn2] quit
[PE1-bgp-default-vpn2] quit
[PE1-bgp-default] quit
# PE 2的配置与PE 1类似,配置过程省略。
配置完成后,在PE设备上执行display bgp peer ipv4 vpn-instance命令,可以看到PE与CE之间的BGP对等体关系已建立,并达到Established状态。
(5) 在PE之间建立MP-IBGP对等体
# 配置PE 1。
[PE1] bgp 100
[PE1-bgp-default] peer 3.3.3.9 as-number 100
[PE1-bgp-default] peer 3.3.3.9 connect-interface loopback 0
[PE1-bgp-default] address-family vpnv4
[PE1-bgp-default-vpnv4] peer 3.3.3.9 enable
[PE1-bgp-default-vpnv4] quit
[PE1-bgp-default] quit
# 配置PE 2。
[PE2] bgp 100
[PE2-bgp-default] peer 1.1.1.9 as-number 100
[PE2-bgp-default] peer 1.1.1.9 connect-interface loopback 0
[PE2-bgp-default] address-family vpnv4
[PE2-bgp-default-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-default-vpnv4] quit
[PE2-bgp-default] quit
配置完成后,在PE设备上执行display bgp peer vpnv4命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。
在PE设备上执行display ip routing-table vpn-instance命令,可以看到去往对端CE的路由。
以PE 1上的VPN 1为例:
[PE1] display ip routing-table vpn-instance vpn1
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.0/24 Direct 0 0 10.1.1.2 GE1/0/1
10.1.1.0/32 Direct 0 0 10.1.1.2 GE1/0/1
10.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.255/32 Direct 0 0 10.1.1.2 GE1/0/1
10.3.1.0/24 BGP 255 0 3.3.3.9 GE1/0/4
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
同一VPN的CE能够相互Ping通,不同VPN的CE不能相互Ping通。
例如:CE 1能够Ping通CE 3(10.3.1.1),但不能Ping通CE 4(10.4.1.1)。
(0)
您好,请知:
以下是MPLS VPN OPTION-B的配置案例及链接:
https://zhiliao.h3c.com/Theme/details/102510
组网说明:
本案例采用H3C HCL模拟器的S5820交换机来模拟MPLS VPN OPTION-B 典型组网配置。为了实现业务的相互隔离,需要将不同的VLAN绑定到不同的VPN实例中进行业务的互通,因此在本案例引入多实例VPN,将相关的业务进行捆绑。其中SW1属于AS100,SW2属于AS200,SW1与SW2的互联使用trunk,允许VLAN 400 VLAN 500通过,最终建立EBGP邻居关系,宣告业务网段,使得相同VPN实例的业务能互通,不同VPN实例的业务不能互通。
VPN实例规划如下:
VPN实例名称 | RD值 | RT值 | 业务类型 | 备注 |
vpn-rt | 100:1 | 100:1 | 实时业务 | |
vpn-nrt | 200:1 | 200:1 | 非实时业务 | |
IP地址规划如下:
设备名称 | 接口/VLAN | IP地址 | 子网掩码位数 | 所属VPN实例 | 备注 |
SW1 | Gi 1/0/2 | 10.0.0.1 | 30 | - | |
VLAN 10 | 192.168.10.1 | 24 | vpn-rt | ||
VLAN 20 | 192.168.20.1 | 24 | vpn-nrt | ||
Loopback 0 | 1.1.1.1 | 32 | vpn-rt | Router-id | |
SW2 | GI 1/0/2 | 10.0.0.2 | 30 | - | |
VLAN 100 | 172.16.10.1 | 24 | vpn-rt | ||
VLAN 200 | 172.16.20.1 | 24 | vpn-nrt | ||
Loopback 0 | 3.3.3.3 | 32 | Router-id |
SW1:
System View: return to User View with Ctrl+Z.
[H3C]sysname SW1
[SW1]int loopback 0
[SW1-LoopBack0]ip address 1.1.1.1 32
[SW1-LoopBack0]quit
[SW1]ip vpn-instance vpn-rt
[SW1-vpn-instance-vpn-rt]route-distinguisher 100:1
[SW1-vpn-instance-vpn-rt]vpn-target 100:1
[SW1-vpn-instance-vpn-rt]quit
[SW1]ip vpn-instance vpn-nrt
[SW1-vpn-instance-vpn-nrt]route-distinguisher 200:1
[SW1-vpn-instance-vpn-nrt]vpn-target 200:1
[SW1-vpn-instance-vpn-nrt]quit
[SW1]mpls lsr-id 1.1.1.1
[SW1]mpls ldp
[SW1-ldp]quit
[SW1]vlan 10
[SW1-vlan10]quit
[SW1]vlan 20
[SW1-vlan20]quit
[SW1]int vlan 10
[SW1-Vlan-interface10]ip binding vpn-instance vpn-rt
Some configurations on the interface are removed.
[SW1-Vlan-interface10]ip address 192.168.10.1 24
[SW1-Vlan-interface10]quit
[SW1]int vlan 20
[SW1-Vlan-interface20]ip binding vpn-instance vpn-nrt
Some configurations on the interface are removed.
[SW1-Vlan-interface20]ip address 192.168.20.1 24
[SW1-Vlan-interface20]quit
[SW1]int gi 1/0/3
[SW1-GigabitEthernet1/0/3]port link-mode bridge
[SW1-GigabitEthernet1/0/3]port link-type access
[SW1-GigabitEthernet1/0/3]port access vlan 10
[SW1-GigabitEthernet1/0/3]quit
[SW1]int gi 1/0/4
[SW1-GigabitEthernet1/0/4]port link-mode bridge
[SW1-GigabitEthernet1/0/4]port link-type access
[SW1-GigabitEthernet1/0/4]port access vlan 20
[SW1-GigabitEthernet1/0/4]quit
[SW1]int gi 1/0/2
[SW1-GigabitEthernet1/0/2]port link-mode route
[SW1-GigabitEthernet1/0/2]des
[SW1-GigabitEthernet1/0/2]ip address 10.0.0.1 30
[SW1-GigabitEthernet1/0/2]mpls enable
[SW1-GigabitEthernet1/0/2]mpls ldp enable
[SW1-GigabitEthernet1/0/2]quit
[SW1]bgp 100
[SW1-bgp-default]router-id 1.1.1.1
[SW1-bgp-default]peer 10.0.0.2 as-number 200
[SW1-bgp-default]address-family ipv4 unicast
[SW1-bgp-default-ipv4]peer 10.0.0.2 enable
[SW1-bgp-default-ipv4]import-route direct
[SW1-bgp-default-ipv4]quit
[SW1-bgp-default]address-family vpnv4
[SW1-bgp-default-vpnv4]peer 10.0.0.2 enable
[SW1-bgp-default-vpnv4]quit
[SW1-bgp-default]ip vpn-instance vpn-rt
[SW1-bgp-default-vpn-rt]address-family ipv4 unicast
[SW1-bgp-default-ipv4-vpn-rt]network 192.168.10.0 255.255.255.0
[SW1-bgp-default-ipv4-vpn-rt]quit
[SW1-bgp-default-vpn-rt]quit
[SW1-bgp-default]ip vpn-instance vpn-nrt
[SW1-bgp-default-vpn-nrt]address-family ipv4 unicast
[SW1-bgp-default-ipv4-vpn-nrt]network 192.168.20.0 255.255.255.0
[SW1-bgp-default-ipv4-vpn-nrt]quit
[SW1-bgp-default-vpn-nrt]quit
[SW1-bgp-default]quit
SW2:
System View: return to User View with Ctrl+Z.
[H3C]sysname SW2
[SW2]int loopback 0
[SW2-LoopBack0]ip address 3.3.3.3 32
[SW2-LoopBack0]quit
[SW2]ip vpn-instance vpn-rt
[SW2-vpn-instance-vpn-rt]route-distinguisher 100:1
[SW2-vpn-instance-vpn-rt]vpn-target 100:1
[SW2-vpn-instance-vpn-rt]quit
[SW2]ip vpn-instance vpn-nrt
[SW2-vpn-instance-vpn-nrt]route-distinguisher 200:1
[SW2-vpn-instance-vpn-nrt]vpn-target 200:1
[SW2-vpn-instance-vpn-nrt]quit
[SW2]router id 3.3.3.3
[SW2]mpls lsr-id 3.3.3.3
[SW2]mpls ldp
[SW2-ldp]quit
[SW2]vlan 100
[SW2-vlan100]quit
[SW2]vlan 200
[SW2-vlan200]quit
[SW2]int vlan 100
[SW2-Vlan-interface100]ip binding vpn-instance vpn-rt
Some configurations on the interface are removed.
[SW2-Vlan-interface100]ip address 172.16.10.1 24
[SW2-Vlan-interface100]quit
[SW2]int vlan 200
[SW2-Vlan-interface200]ip binding vpn-instance vpn-nrt
Some configurations on the interface are removed.
[SW2-Vlan-interface200]ip address 172.16.20.1 24
[SW2-Vlan-interface200]quit
[SW2]int gi 1/0/3
[SW2-GigabitEthernet1/0/3]port link-mode bridge
[SW2-GigabitEthernet1/0/3]port link-type access
[SW2-GigabitEthernet1/0/3]port access vlan 100
[SW2-GigabitEthernet1/0/3]quit
[SW2]int gi 1/0/4
[SW2-GigabitEthernet1/0/4]port link-mode bridge
[SW2-GigabitEthernet1/0/4]port link-type access
[SW2-GigabitEthernet1/0/4]port access vlan 200
[SW2-GigabitEthernet1/0/4]quit
[SW2]int gi 1/0/2
[SW2-GigabitEthernet1/0/2]port link-mode route
[SW2-GigabitEthernet1/0/2]des
[SW2-GigabitEthernet1/0/2]ip address 10.0.0.2 30
[SW2-GigabitEthernet1/0/2]mpls enable
[SW2-GigabitEthernet1/0/2]mpls ldp enable
[SW2-GigabitEthernet1/0/2]quit
[SW2]bgp 200
[SW2-bgp-default]router-id 2.2.2.2
[SW2-bgp-default]peer 10.0.0.1 as-number 100
[SW2-bgp-default]address-family ipv4 unicast
[SW2-bgp-default-ipv4]peer 10.0.0.1 enable
[SW2-bgp-default-ipv4]import-route direct
[SW2-bgp-default-ipv4]quit
[SW2-bgp-default]address-family vpnv4
[SW2-bgp-default-vpnv4]peer 10.0.0.1 enable
[SW2-bgp-default-vpnv4]quit
[SW2-bgp-default]ip vpn-instance vpn-rt
[SW2-bgp-default-vpn-rt]address-family ipv4 unicast
[SW2-bgp-default-ipv4-vpn-rt]network 172.16.10.0 255.255.255.0
[SW2-bgp-default-ipv4-vpn-rt]quit
[SW2-bgp-default-vpn-rt]quit
[SW2-bgp-default]ip vpn-instance vpn-nrt
[SW2-bgp-default-vpn-nrt]address-family ipv4 unicast
[SW2-bgp-default-ipv4-vpn-nrt]network 172.16.20.0 255.255.255.0
[SW2-bgp-default-ipv4-vpn-nrt]quit
[SW2-bgp-default-vpn-nrt]quit
[SW2-bgp-default]quit
PC都填写IP地址:
相同VPN实例的业务可以互通,不同VPN实例的业务不可以互通:
查看SW1的BGP邻居信息:
查看SW2的BGP邻居信息:
查看SW1的VPN路由表:
查看SW2的VPN路由表:
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论