From e866c82778a24105f2a5b955550af6296cc50b2a Mon Sep 17 00:00:00 2001 From: Karl Newell Date: Thu, 27 Sep 2018 18:34:22 -0400 Subject: [PATCH] Update NTC lab --- core/core-model-csr.yml | 4 +-- core_config/ansible-csr1-config.txt | 42 ++++++++++++++++++++++++++++- core_config/ansible-csr2-config.txt | 16 ++++++++++- core_config/ansible-csr3-config.txt | 16 ++++++++++- core_config/ansible-csr4-config.txt | 16 ++++++++++- core_config/ansible-csr5-config.txt | 16 ++++++++++- core_config/ansible-csr6-config.txt | 16 ++++++++++- ios/core.j2 | 30 +++++++++++++++++++++ nodes.yml | 17 +++++++----- 9 files changed, 159 insertions(+), 14 deletions(-) diff --git a/core/core-model-csr.yml b/core/core-model-csr.yml index b91bcc3..7046350 100644 --- a/core/core-model-csr.yml +++ b/core/core-model-csr.yml @@ -76,8 +76,8 @@ links: cost: 10, mpls: True, iso: True } bgp: - rr: [10.0.0.51] - clients: [10.0.0.52, 100.0.53, 10.0.0.54, 10.0.0.55, 10.0.0.56] + rr: [1.1.1.1] + clients: [2.2.2.2, 3.3.3.3, 4.4.4.4, 5.5.5.5, 6.6.6.6] af: - inet - inet-vpn diff --git a/core_config/ansible-csr1-config.txt b/core_config/ansible-csr1-config.txt index 420230f..37b95e4 100644 --- a/core_config/ansible-csr1-config.txt +++ b/core_config/ansible-csr1-config.txt @@ -76,7 +76,47 @@ router ospf 1 network 172.10.12.1 0.0.0.255 area 0 network 172.10.14.1 0.0.0.255 area 0 network 172.10.13.1 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 2.2.2.2 remote-as 65000 + neighbor 2.2.2.2 update-source Loopback0 + neighbor 3.3.3.3 remote-as 65000 + neighbor 3.3.3.3 update-source Loopback0 + neighbor 4.4.4.4 remote-as 65000 + neighbor 4.4.4.4 update-source Loopback0 + neighbor 5.5.5.5 remote-as 65000 + neighbor 5.5.5.5 update-source Loopback0 + neighbor 6.6.6.6 remote-as 65000 + neighbor 6.6.6.6 update-source Loopback0 + ! + address-family ipv4 + neighbor 2.2.2.2 activate + neighbor 2.2.2.2 route-reflector-client + neighbor 3.3.3.3 activate + neighbor 3.3.3.3 route-reflector-client + neighbor 4.4.4.4 activate + neighbor 4.4.4.4 route-reflector-client + neighbor 5.5.5.5 activate + neighbor 5.5.5.5 route-reflector-client + neighbor 6.6.6.6 activate + neighbor 6.6.6.6 route-reflector-client + exit-address-family + ! + address-family vpnv4 + neighbor 2.2.2.2 activate + neighbor 2.2.2.2 route-reflector-client + neighbor 3.3.3.3 activate + neighbor 3.3.3.3 route-reflector-client + neighbor 4.4.4.4 activate + neighbor 4.4.4.4 route-reflector-client + neighbor 5.5.5.5 activate + neighbor 5.5.5.5 route-reflector-client + neighbor 6.6.6.6 activate + neighbor 6.6.6.6 route-reflector-client + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/core_config/ansible-csr2-config.txt b/core_config/ansible-csr2-config.txt index f962b83..1595005 100644 --- a/core_config/ansible-csr2-config.txt +++ b/core_config/ansible-csr2-config.txt @@ -76,7 +76,21 @@ router ospf 1 network 172.10.12.2 0.0.0.255 area 0 network 172.10.23.2 0.0.0.255 area 0 network 172.10.25.2 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 1.1.1.1 remote-as 65000 + neighbor 1.1.1.1 update-source Loopback0 + ! + address-family ipv4 + neighbor 1.1.1.1 activate + exit-address-family + ! + address-family vpnv4 + neighbor 1.1.1.1 activate + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/core_config/ansible-csr3-config.txt b/core_config/ansible-csr3-config.txt index 917904b..2f705eb 100644 --- a/core_config/ansible-csr3-config.txt +++ b/core_config/ansible-csr3-config.txt @@ -69,7 +69,21 @@ router ospf 1 router-id 3.3.3.3 network 172.10.23.3 0.0.0.255 area 0 network 172.10.13.3 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 1.1.1.1 remote-as 65000 + neighbor 1.1.1.1 update-source Loopback0 + ! + address-family ipv4 + neighbor 1.1.1.1 activate + exit-address-family + ! + address-family vpnv4 + neighbor 1.1.1.1 activate + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/core_config/ansible-csr4-config.txt b/core_config/ansible-csr4-config.txt index 13efcdc..1004e06 100644 --- a/core_config/ansible-csr4-config.txt +++ b/core_config/ansible-csr4-config.txt @@ -76,7 +76,21 @@ router ospf 1 network 172.10.45.4 0.0.0.255 area 0 network 172.10.14.4 0.0.0.255 area 0 network 172.10.46.4 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 1.1.1.1 remote-as 65000 + neighbor 1.1.1.1 update-source Loopback0 + ! + address-family ipv4 + neighbor 1.1.1.1 activate + exit-address-family + ! + address-family vpnv4 + neighbor 1.1.1.1 activate + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/core_config/ansible-csr5-config.txt b/core_config/ansible-csr5-config.txt index 236fa34..e9c720d 100644 --- a/core_config/ansible-csr5-config.txt +++ b/core_config/ansible-csr5-config.txt @@ -76,7 +76,21 @@ router ospf 1 network 172.10.45.5 0.0.0.255 area 0 network 172.10.56.5 0.0.0.255 area 0 network 172.10.25.5 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 1.1.1.1 remote-as 65000 + neighbor 1.1.1.1 update-source Loopback0 + ! + address-family ipv4 + neighbor 1.1.1.1 activate + exit-address-family + ! + address-family vpnv4 + neighbor 1.1.1.1 activate + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/core_config/ansible-csr6-config.txt b/core_config/ansible-csr6-config.txt index 5de9e01..2a52f77 100644 --- a/core_config/ansible-csr6-config.txt +++ b/core_config/ansible-csr6-config.txt @@ -69,7 +69,21 @@ router ospf 1 router-id 6.6.6.6 network 172.10.56.6 0.0.0.255 area 0 network 172.10.46.6 0.0.0.255 area 0 - virtual-service csr_mgmt + ! +router bgp 65000 + neighbor 1.1.1.1 remote-as 65000 + neighbor 1.1.1.1 update-source Loopback0 + ! + address-family ipv4 + neighbor 1.1.1.1 activate + exit-address-family + ! + address-family vpnv4 + neighbor 1.1.1.1 activate + exit-address-family + ! +! +virtual-service csr_mgmt ! ip forward-protocol nd ip http server diff --git a/ios/core.j2 b/ios/core.j2 index 61833df..8a3c919 100644 --- a/ios/core.j2 +++ b/ios/core.j2 @@ -76,6 +76,36 @@ router ospf 1 {% for intf,intf_attr in node.links.items() %} network {{intf_attr.ip}} 0.0.0.255 area {{node.ospf.area}} {% endfor %} +! +router bgp {{common.bgp_asn}} +{% for peer in node.bgp.ibgp.peers %} + neighbor {{peer}} remote-as {{common.bgp_asn}} + neighbor {{peer}} update-source Loopback0 +{% endfor %} + ! +{% if 'inet' in node.bgp.ibgp.af %} + address-family ipv4 + {% for peer in node.bgp.ibgp.peers %} + neighbor {{peer}} activate + {% if node.bgp.ibgp.rr is defined and node.bgp.ibgp.rr == true %} + neighbor {{peer}} route-reflector-client + {% endif %} + {% endfor %} + exit-address-family +{% endif %} + ! +{% if 'inet-vpn' in node.bgp.ibgp.af %} + address-family vpnv4 + {% for peer in node.bgp.ibgp.peers %} + neighbor {{peer}} activate + {% if node.bgp.ibgp.rr is defined and node.bgp.ibgp.rr == true %} + neighbor {{peer}} route-reflector-client + {% endif %} + {% endfor %} + exit-address-family +{% endif %} + ! +! virtual-service csr_mgmt ! ip forward-protocol nd diff --git a/nodes.yml b/nodes.yml index 7e11bd3..4c285bf 100644 --- a/nodes.yml +++ b/nodes.yml @@ -20,8 +20,13 @@ nodes: GigabitEthernet3.0: { ip: 172.10.14.1, remote: ansible-csr4 , cost: 10 , vlan: 0 , mpls: True , iso: True} bgp: ibgp: + rr: true peers: - - 10.0.0.51 + - 2.2.2.2 + - 3.3.3.3 + - 4.4.4.4 + - 5.5.5.5 + - 6.6.6.6 af: - inet - inet-vpn @@ -41,7 +46,7 @@ nodes: bgp: ibgp: peers: - - 10.0.0.51 + - 1.1.1.1 af: - inet - inet-vpn @@ -60,7 +65,7 @@ nodes: bgp: ibgp: peers: - - 10.0.0.51 + - 1.1.1.1 af: - inet - inet-vpn @@ -80,7 +85,7 @@ nodes: bgp: ibgp: peers: - - 10.0.0.51 + - 1.1.1.1 af: - inet - inet-vpn @@ -100,7 +105,7 @@ nodes: bgp: ibgp: peers: - - 10.0.0.51 + - 1.1.1.1 af: - inet - inet-vpn @@ -119,7 +124,7 @@ nodes: bgp: ibgp: peers: - - 10.0.0.51 + - 1.1.1.1 af: - inet - inet-vpn