1 拓扑
2 配置步骤
2.1 在MPLS节点上配置接口IP 和路由协议
PE1
interface LoopBack 0
ip address 1.1.1.9 32
quit
interface GigabitEthernet4/0
ip address 172.1.1.1 24
quit
ospf 1
area 1
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
quit
quit
P
interface LoopBack 0
ip address 2.2.2.9 32
quit
interface GigabitEthernet4/0
ip address 172.1.1.2 24
quit
interface GigabitEthernet5/0
ip address 172.2.1.1 24
quit
ospf 1
area 1
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
quit
quit
PE2
interface LoopBack 0
ip address 3.3.3.9 32
quit
interface GigabitEthernet4/0
ip address 172.2.1.2 24
quit
ospf 1
area 1
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
quit
quit
查看OSPF学习情况
2.2 配置MPLS LDP
PE1
mpls lsr-id 1.1.1.9
mpls label advertise non-null
mpls ldp
quit
interface GigabitEthernet4/0
mpls enable
mpls ldp enable
quit
P
mpls lsr-id 2.2.2.9
mpls label advertise non-null
mpls ldp
quit
interface GigabitEthernet4/0
mpls enable
mpls ldp enable
quit
interface GigabitEthernet5/0
mpls enable
mpls ldp enable
quit
PE2
mpls lsr-id 3.3.3.9
mpls label advertise non-null
mpls ldp
quit
interface GigabitEthernet4/0
mpls enable
mpls ldp enable
quit
查看 LDP LSP
2.3 在PE设备上配置VPN实例
PE1
ip vpn-instance vpn1
route-distinguisher 100:1
vpn-target 111:1
quit
interface GigabitEthernet1/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 24
quit
ip vpn-instance vpn2
route-distinguisher 100:2
vpn-target 222:2
quit
interface GigabitEthernet2/0
ip binding vpn-instance vpn2
ip address 10.2.1.2 24
quit
PE2
ip vpn-instance vpn1
route-distinguisher 200:1
vpn-target 111:1
quit
interface GigabitEthernet1/0
ip binding vpn-instance vpn1
ip address 10.3.1.2 24
quit
ip vpn-instance vpn2
route-distinguisher 200:2
vpn-target 222:2
quit
interface GigabitEthernet2/0
ip binding vpn-instance vpn2
ip address 10.4.1.2 24
quit
查看配置
2.4 在PE与CE之间建立EBGP对等体,引入VPN路由
PE1
bgp 100
ip vpn-instance vpn1
peer 10.1.1.1 as-number 65410
address-family ipv4 unicast
peer 10.1.1.1 enable
quit
quit
ip vpn-instance vpn2
peer 10.2.1.1 as-number 65420
address-family ipv4 unicast
peer 10.2.1.1 enable
quit
quit
quit
CE1
interface GigabitEthernet1/0
ip address 10.1.1.1 24
quit
bgp 65410
peer 10.1.1.2 as-number 100
address-family ipv4 unicast
peer 10.1.1.2 enable
import-route direct
quit
quit
CE2
interface GigabitEthernet1/0
ip address 10.2.1.1 24
quit
bgp 65420
peer 10.2.1.2 as-number 100
address-family ipv4 unicast
peer 10.2.1.2 enable
import-route direct
quit
quit
查看BGP状态
PE2
bgp 100
ip vpn-instance vpn1
peer 10.3.1.1 as-number 65430
address-family ipv4 unicast
peer 10.3.1.1 enable
quit
quit
ip vpn-instance vpn2
peer 10.4.1.1 as-number 65440
address-family ipv4 unicast
peer 10.4.1.1 enable
quit
quit
quit
CE3
interface GigabitEthernet1/0
ip address 10.3.1.1 24
quit
bgp 65430
peer 10.3.1.2 as-number 100
address-family ipv4 unicast
peer 10.3.1.2 enable
import-route direct
quit
quit
CE4
interface GigabitEthernet1/0
ip address 10.4.1.1 24
quit
bgp 65440
peer 10.4.1.2 as-number 100
address-family ipv4 unicast
peer 10.4.1.2 enable
import-route direct
quit
quit
查看BGP状态
2.5 在PE之间建立MP-IBGP对等体
PE1
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface loopback 0
address-family vpnv4
peer 3.3.3.9 enable
quit
quit
PE2
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface loopback 0
address-family vpnv4
peer 1.1.1.9 enable
quit
quit
查看BGP状态
查看VPN1路由表
查看VPN2路由表
另一种查看VPN路由方式,查看BGP路由器表
查看VPN标签
2.6 验证
CE1 ping CE3
CE2 ping CE4