19/07/2018

Huawei – Most basic L3VPN

Just a basic L3VPN for my own learning purposes 🙂

 

H3CvSR20001

ip vpn-instance Management
 route-distinguisher 1:99
 description Management
 #
 address-family ipv4
  vpn-target 2:99 3:99 1:99 import-extcommunity
  vpn-target 2:99 3:99 1:99 export-extcommunity
#
 router id 1.1.1.1
#
ospf 1
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0
  network 10.1.2.0 0.0.0.3
  network 10.1.3.0 0.0.0.3
#
 mpls lsr-id 1.1.1.1
#
mpls ldp
 lsr-id 1.1.1.1
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
#
interface GigabitEthernet1/0
 port link-mode route
 ip address 10.1.2.1 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet2/0
 port link-mode route
 ip address 10.1.3.1 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet3/0
 port link-mode route
#
interface GigabitEthernet4/0
 port link-mode route
 ip binding vpn-instance Management
 ip address 10.99.1.254 255.255.255.0
#
bgp 31543
 router-id 1.1.1.1
 peer 2.2.2.2 as-number 31543
 peer 2.2.2.2 connect-interface LoopBack0
 peer 3.3.3.3 as-number 31543
 peer 3.3.3.3 connect-interface LoopBack0
 #
 address-family ipv4 unicast
  network 1.1.1.1 255.255.255.255
  peer 2.2.2.2 enable
  peer 3.3.3.3 enable
 #
 address-family vpnv4
  peer 2.2.2.2 enable
  peer 2.2.2.2 advertise-community
  peer 3.3.3.3 enable
  peer 3.3.3.3 advertise-community
 #
 ip vpn-instance Management
  #
  address-family ipv4 unicast
   import-route direct
   import-route static

 

H3CvSR20002

ip vpn-instance Management
 route-distinguisher 2:99
 vpn-target 2:99 import-extcommunity
 vpn-target 2:99 export-extcommunity
 #
 address-family ipv4
  vpn-target 1:99 3:99 2:99 import-extcommunity
  vpn-target 1:99 3:99 2:99 export-extcommunity
#
 router id 2.2.2.2
#
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 10.1.2.0 0.0.0.3
  network 10.2.3.0 0.0.0.3
#
 mpls lsr-id 2.2.2.2
#
mpls ldp
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
#
interface GigabitEthernet1/0
 port link-mode route
 ip address 10.1.2.2 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet2/0
 port link-mode route
 ip address 10.2.3.1 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet3/0
 port link-mode route
#
interface GigabitEthernet4/0
 port link-mode route
 ip binding vpn-instance Management
 ip address 10.99.2.254 255.255.255.0
#
bgp 31543
 router-id 2.2.2.2
 peer 1.1.1.1 as-number 31543
 peer 1.1.1.1 connect-interface LoopBack0
 peer 3.3.3.3 as-number 31543
 peer 3.3.3.3 connect-interface LoopBack0
 #
 address-family ipv4 unicast
  network 2.2.2.2 255.255.255.255
  peer 1.1.1.1 enable
  peer 3.3.3.3 enable
 #
 address-family vpnv4
  peer 1.1.1.1 enable
  peer 1.1.1.1 advertise-community
  peer 3.3.3.3 enable
  peer 3.3.3.3 advertise-community
 #
 ip vpn-instance Management
  #
  address-family ipv4 unicast
   import-route direct
   import-route static

 

H3CvSR20003

ip vpn-instance Management
 route-distinguisher 3:99
 vpn-target 3:99 1:99 2:99 import-extcommunity
 vpn-target 3:99 1:99 2:99 export-extcommunity
 #
 address-family ipv4
  vpn-target 3:99 1:99 2:99 import-extcommunity
  vpn-target 3:99 1:99 2:99 export-extcommunity
#
 router id 3.3.3.3
#
ospf 1
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 10.1.3.0 0.0.0.3
  network 10.2.3.0 0.0.0.3
#
 mpls lsr-id 3.3.3.3
#
mpls ldp
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
#
interface GigabitEthernet1/0
 port link-mode route
 ip address 10.2.3.2 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet2/0
 port link-mode route
 ip address 10.1.3.2 255.255.255.252
 mpls enable
 mpls ldp enable
#
interface GigabitEthernet3/0
 port link-mode route
#
interface GigabitEthernet4/0
 port link-mode route
 ip binding vpn-instance Management
 ip address 10.99.3.254 255.255.255.0
#
bgp 31543
 router-id 3.3.3.3
 peer 1.1.1.1 as-number 31543
 peer 1.1.1.1 connect-interface LoopBack0
 peer 2.2.2.2 as-number 31543
 peer 2.2.2.2 connect-interface LoopBack0
 #
 address-family ipv4 unicast
  network 3.3.3.3 255.255.255.255
  peer 1.1.1.1 enable
  peer 2.2.2.2 enable
 #
 address-family vpnv4
  peer 1.1.1.1 enable
  peer 2.2.2.2 enable
 #
 ip vpn-instance Management
  #
  address-family ipv4 unicast
   import-route direct
   import-route static

 

[H3CvSR20003]dis bgp routing-table ipv4 vpn-instance Management

 Total number of routes: 4

 BGP local router ID is 3.3.3.3
 Status codes: * - valid, > - best, d - dampened, h - history,
               s - suppressed, S - stale, i - internal, e - external
               Origin: i - IGP, e - EGP, ? - incomplete

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

* >i 10.99.1.0/24       1.1.1.1         0          100        0       ?
* >i 10.99.2.0/24       2.2.2.2         0          100        0       ?
* >  10.99.3.0/24       10.99.3.254     0                     32768   ?
* >  10.99.3.254/32     127.0.0.1       0                     32768   ?
[H3CvSR20003]