MPLSVPN跨域实验

稚 发布于 2024-08-26 40 次阅读


Option A

AR1

interface GigabitEthernet0/0/0
 ip address 10.0.12.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 
#
bgp 65001
 peer 10.0.12.2 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 1.1.1.1 255.255.255.255 
  peer 10.0.12.2 enable

AR2

#
ip vpn-instance ar1
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance ar1
 ip address 10.0.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.23.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255 
#
bgp 100
 peer 4.4.4.4 as-number 100 
 peer 4.4.4.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 4.4.4.4 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 4.4.4.4 enable
 #
 ipv4-family vpn-instance ar1 
  peer 10.0.12.1 as-number 65001 
#
ospf 1 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.0.23.0 0.0.0.255 
#

AR3

#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.0.23.3 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.34.3 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 10.0.23.0 0.0.0.255 
  network 10.0.34.0 0.0.0.255 
#

AR4

ip vpn-instance ar1
 ipv4-family
  route-distinguisher 200:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.0.34.4 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance ar1
 ip address 10.0.45.4 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 
#
bgp 100
 peer 2.2.2.2 as-number 100 
 peer 2.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
 # 
 ipv4-family vpnv4
 policy vpn-target
  peer 2.2.2.2 enable
 #
 ipv4-family vpn-instance ar1 
  peer 10.0.45.5 as-number 200 
#
ospf 1 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 10.0.34.0 0.0.0.255 
#

AR5

ip vpn-instance ar8
 ipv4-family
  route-distinguisher 200:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance ar8
 ip address 10.0.45.5 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.56.5 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255 
#
bgp 200
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 7.7.7.7 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 7.7.7.7 enable
 #
 ipv4-family vpn-instance ar8 
  peer 10.0.45.4 as-number 100 
#
ospf 1 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 10.0.56.5 0.0.0.0

AR6

interface GigabitEthernet0/0/0
 ip address 10.0.56.6 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.67.6 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 6.6.6.6 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 6.6.6.6 0.0.0.0 
  network 10.0.56.6 0.0.0.0 
  network 10.0.67.6 0.0.0.0

AR7

ip vpn-instance ar8
 ipv4-family
  route-distinguisher 100:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 7.7.7.7
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.0.67.7 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance ar8
 ip address 10.0.78.7 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 7.7.7.7 255.255.255.255 
#
bgp 200
 peer 5.5.5.5 as-number 200 
 peer 5.5.5.5 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 5.5.5.5 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 5.5.5.5 enable
 #
 ipv4-family vpn-instance ar8 
  peer 10.0.78.8 as-number 65002 
#
ospf 1 
 area 0.0.0.0 
  network 7.7.7.7 0.0.0.0 
  network 10.0.67.7 0.0.0.0 

AR8

interface GigabitEthernet0/0/0
 ip address 10.0.78.8 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 8.8.8.8 255.255.255.255 
#
bgp 65002
 peer 10.0.78.7 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  network 8.8.8.8 255.255.255.255 
  peer 10.0.78.7 enable
#

验证


Option B


对于optionb 在ar4与ar5之间配置mp-ebgp路由 这时会检查rt值我们需要配置对rt值不进行检查 undo policy vpn-target 并且需要配置mpbgp分配标签的功能 其他与optiona相同

ar4

mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.0.34.4 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.45.4 255.255.255.0 
 mpls
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 
#
bgp 100
 peer 2.2.2.2 as-number 100 
 peer 2.2.2.2 connect-interface LoopBack0
 peer 10.0.45.5 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
  peer 10.0.45.5 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  apply-label per-nexthop
  peer 2.2.2.2 enable
  peer 10.0.45.5 enable
#
ospf 1 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 10.0.34.0 0.0.0.255 

AR5

mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.0.45.5 255.255.255.0 
 mpls
#
interface GigabitEthernet0/0/1
 ip address 10.0.56.5 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255 
#
bgp 200
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack0
 peer 10.0.45.4 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  peer 7.7.7.7 enable
  peer 10.0.45.4 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  apply-label per-nexthop 
  peer 7.7.7.7 enable
  peer 10.0.45.4 enable
#
ospf 1 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 10.0.56.5 0.0.0.0