Tip

This is the documentation for the 19.12 version. Looking for the documentation of the latest version? Have a look here.

Edge Router Speaking eBGP with Static Redistribution for IPv4 And IPv6

Use Case

Especially in cases where an enterprise is multi-homed with it’s own block of network addresses, it may become necessary to configure dynamic routing between network service providers. This is accomplished by use of external BGP (eBGP).

In this use case, the enterprise will use TNSR to speak eBGP with two network service providers, in order to exchange routes which may be redistributed from static/connected routing.

Example Scenario

In this example, the enterprise using TNSR will have a fictitious autonomous system number (ASN) of 65505. The network service providers in this example will have ASNs of 65510 and 65520. The enterprise using TNSR will redistribute a single /24 network from static into BGP. That network will then be advertised to each of the service providers. The service providers will announce a full routing table to the TNSR instance.

Scenario Topology

../../_images/diagram-ebgp-router-ipv4.png

TNSR BGP Router (IPv4)

../../_images/diagram-ebgp-router-ipv6.png

TNSR BGP Router (IPv6)

BGP Router Setup Parameters

Item

Value

TNSR Autonomous System Number

65505

ISP_A Autonomous System Number

65510

ISP_B Autonomous System Number

65520

IPv4 Network to be announced

192.0.2.0/24

IPv6 Network to be announced

2001:db8:a100:1005::/64

TNSR to ISP_A IPv4 Network Address

203.0.113.8/30

TNSR to ISP_A IPv6 Global Address

2001:db8:fa00:ffaa::/64

TNSR to ISP_B IPv4 Network Address

100.64.0.48/30

TNSR to ISP_B IPv6 Global Address

2001:db8:fb00:ffbb::/64

TNSR Configuration Steps

Step 1: Configure Interfaces

tnsr# conf
tnsr(config)# interface GigabitEthernet0/13/0
tnsr(config-interface)# description "To ISP A"
tnsr(config-interface)# ip address 203.0.113.9/30
tnsr(config-interface)# ipv6 address 2001:db8:1000:aaaa::2/64
tnsr(config-interface)# enable
tnsr(config-interface)# exit
tnsr(config)#
tnsr(config)# interface GigabitEthernet0/14/0
tnsr(config-interface)# description "To ISP B"
tnsr(config-interface)# ip address 100.64.0.49/30
tnsr(config-interface)# ipv6 address 2001:db8:9999:ffff::2/64
tnsr(config-interface)# enable
tnsr(config-interface)# exit
tnsr(config)#

Step 2: Enable BGP

tnsr(config)# route dynamic bgp
tnsr(config-frr-bgp)# enable
tnsr(config-frr-bgp)# exit
tnsr(config)#

Step 3: Create prefix-lists for route export via BGP

tnsr(config)# route dynamic prefix-list EXPORT_IPv4
tnsr(config-prefix-list)# description "IPv4 Routes to Export"
tnsr(config-prefix-list)# seq 10 permit 192.0.2.0/24
tnsr(config-prefix-list)# exit
tnsr(config)#
tnsr(config)# route dynamic prefix-list EXPORT_IPv6
tnsr(config-prefix-list)# description "IPv6 Routes to Export"
tnsr(config-prefix-list)# seq 10 permit 2001:db8:a100:1005::/64
tnsr(config-prefix-list)# exit
tnsr(config)#

Step 4: Create static route for networks to be advertised in BGP

tnsr(config)# route ipv4 table ipv4-VRF:0
tnsr(config-route-table-v4)# route 192.0.2.0/24
tnsr(config-rttbl4-next-hop)# next-hop 1 via local
tnsr(config-rttbl4-next-hop)# exit
tnsr(config-route-table-v4)# exit
tnsr(config)# route ipv6 table ipv6-VRF:0
tnsr(config-route-table-v6)# route 2001:db8:a100:1005::/64
tnsr(config-rttbl6-next-hop)# next-hop 1 via local
tnsr(config-rttbl6-next-hop)# exit
tnsr(config-route-table-v6)# exit
tnsr(config)#

Step 5: Configure BGP global options

tnsr(config)# route dynamic bgp
tnsr(config-frr-bgp)# server 65505
tnsr(config-bgp)# router-id 203.0.113.9
tnsr(config-bgp)# address-family ipv4 unicast
tnsr(config-bgp-ip4uni)# redistribute kernel
tnsr(config-bgp-ip4uni)# exit
tnsr(config-bgp)# address-family ipv6 unicast
tnsr(config-bgp-ip4uni)# redistribute kernel
tnsr(config-bgp-ip4uni)# exit
tnsr(config-bgp)#

Step 6: Configure BGP global neighbor options

tnsr(config-bgp)# neighbor 203.0.113.10
tnsr(config-bgp-neighbor)# remote-as 65510
tnsr(config-bgp-neighbor)# description "ISP_A IPv4"
tnsr(config-bgp-neighbor)# enable
tnsr(config-bgp-neighbor)# exit
tnsr(config-bgp)# neighbor 2001:db8:1000:aaaa::1
tnsr(config-bgp-neighbor)# remote-as 65510
tnsr(config-bgp-neighbor)# description "ISP_A IPv6"
tnsr(config-bgp-neighbor)# enable
tnsr(config-bgp-neighbor)# exit
tnsr(config-bgp)# neighbor 100.64.0.50
tnsr(config-bgp-neighbor)# remote-as 65520
tnsr(config-bgp-neighbor)# description "ISP_B IPv4"
tnsr(config-bgp-neighbor)# enable
tnsr(config-bgp-neighbor)# exit
tnsr(config-bgp)# neighbor 2001:db8:9999:ffff::1
tnsr(config-bgp-neighbor)# remote-as 65520
tnsr(config-bgp-neighbor)# description "ISP_B IPv6"
tnsr(config-bgp-neighbor)# enable
tnsr(config-bgp-neighbor)# exit
tnsr(config-bgp)#

Step 7: Configure BGP neighbor address-family IPv4 unicast options

tnsr(config-bgp)# address-family ipv4 unicast
tnsr(config-bgp-ip4uni)# neighbor 203.0.113.10
tnsr(config-bgp-ip4uni-nbr)# prefix-list EXPORT_IPv4 out
tnsr(config-bgp-ip4uni-nbr)# activate
tnsr(config-bgp-ip4uni-nbr)# exit
tnsr(config-bgp-ip4uni)# neighbor 100.64.0.50
tnsr(config-bgp-ip4uni-nbr)# prefix-list EXPORT_IPv4 out
tnsr(config-bgp-ip4uni-nbr)# activate
tnsr(config-bgp-ip4uni-nbr)# exit
tnsr(config-bgp-ip4uni)# exit
tnsr(config-bgp)#

Step 8: Configure BGP neighbor address-family IPv6 unicast options

tnsr(config-bgp)# address-family ipv6 unicast
tnsr(config-bgp-ip4uni)# neighbor 2001:db8:1000:aaaa::1
tnsr(config-bgp-ip4uni-nbr)# prefix-list EXPORT_IPv6 out
tnsr(config-bgp-ip4uni-nbr)# activate
tnsr(config-bgp-ip4uni-nbr)# exit
tnsr(config-bgp-ip4uni)# neighbor 2001:db8:9999:ffff::1
tnsr(config-bgp-ip4uni-nbr)# prefix-list EXPORT_IPv6 out
tnsr(config-bgp-ip4uni-nbr)# activate
tnsr(config-bgp-ip4uni-nbr)# exit
tnsr(config-bgp-ip4uni)# exit
tnsr(config-bgp)# exit
tnsr(config-frr-bgp)# exit
tnsr(config)#

JSON Configuration

  1{
  2  "data": {
  3    "bgp-config": {
  4      "global-options": {
  5        "enable": true
  6      },
  7      "routers": {
  8        "router": [
  9          {
 10            "asn": 65505,
 11            "router-id": "203.0.113.9",
 12            "address-families": {
 13              "address-family": [
 14                {
 15                  "family": "ipv4",
 16                  "subfamily": "labeled-unicast"
 17                },
 18                {
 19                  "family": "ipv4",
 20                  "subfamily": "multicast"
 21                },
 22                {
 23                  "family": "ipv4",
 24                  "subfamily": "unicast",
 25                  "neighbors": {
 26                    "neighbor": [
 27                      {
 28                        "peer": "100.64.0.50",
 29                        "activate": true,
 30                        "prefix-list-out": "EXPORT_IPv4"
 31                      },
 32                      {
 33                        "peer": "203.0.113.10",
 34                        "activate": true,
 35                        "prefix-list-out": "EXPORT_IPv4"
 36                      }
 37                    ]
 38                  },
 39                  "redistributions": {
 40                    "named-sources": {
 41                      "route-source": [
 42                        {
 43                          "source": "kernel",
 44                          "present": true
 45                        }
 46                      ]
 47                    }
 48                  }
 49                },
 50                {
 51                  "family": "ipv4",
 52                  "subfamily": "vpn"
 53                },
 54                {
 55                  "family": "ipv6",
 56                  "subfamily": "labeled-unicast"
 57                },
 58                {
 59                  "family": "ipv6",
 60                  "subfamily": "multicast"
 61                },
 62                {
 63                  "family": "ipv6",
 64                  "subfamily": "unicast",
 65                  "neighbors": {
 66                    "neighbor": [
 67                      {
 68                        "peer": "2001:db8:1000:aaaa::1",
 69                        "activate": true,
 70                        "prefix-list-out": "EXPORT_IPv6"
 71                      },
 72                      {
 73                        "peer": "2001:db8:9999:ffff::1",
 74                        "activate": true,
 75                        "prefix-list-out": "EXPORT_IPv6"
 76                      }
 77                    ]
 78                  },
 79                  "redistributions": {
 80                    "named-sources": {
 81                      "route-source": [
 82                        {
 83                          "source": "kernel",
 84                          "present": true
 85                        }
 86                      ]
 87                    }
 88                  }
 89                },
 90                {
 91                  "family": "ipv6",
 92                  "subfamily": "vpn"
 93                },
 94                {
 95                  "family": "l2vpn",
 96                  "subfamily": "evpn"
 97                },
 98                {
 99                  "family": "vpnv4",
100                  "subfamily": "unicast"
101                },
102                {
103                  "family": "vpnv6",
104                  "subfamily": "unicast"
105                }
106              ]
107            },
108            "neighbors": {
109              "neighbor": [
110                {
111                  "peer": "100.64.0.50",
112                  "capability-negotiate": true,
113                  "description": "<![CDATA[\"ISP_B IPv4\"]]>",
114                  "interface": "GigabitEthernet0/14/0",
115                  "remote-asn": 65520,
116                  "enable": true
117                },
118                {
119                  "peer": "2001:db8:1000:aaaa::1",
120                  "capability-negotiate": true,
121                  "description": "<![CDATA[\"ISP_A IPv6\"]]>",
122                  "interface": "GigabitEthernet0/13/0",
123                  "remote-asn": 65510,
124                  "enable": true
125                },
126                {
127                  "peer": "2001:db8:9999:ffff::1",
128                  "capability-negotiate": true,
129                  "description": "<![CDATA[\"ISP_B IPv6\"]]>",
130                  "interface": "GigabitEthernet0/14/0",
131                  "remote-asn": 65520,
132                  "enable": true
133                },
134                {
135                  "peer": "203.0.113.10",
136                  "capability-negotiate": true,
137                  "description": "<![CDATA[\"ISP_A IPv4\"]]>",
138                  "interface": "GigabitEthernet0/13/0",
139                  "remote-asn": 65510,
140                  "enable": true
141                }
142              ]
143            }
144          }
145        ]
146      }
147    },
148    "interfaces-config": {
149      "interface": [
150        {
151          "name": "GigabitEthernet0/13/0",
152          "description": "<![CDATA[\"To ISP A\"]]>",
153          "enabled": true,
154          "ipv4": {
155            "enabled": true,
156            "forwarding": false,
157            "address": {
158              "ip": "203.0.113.9/30"
159            }
160          },
161          "ipv6": {
162            "enabled": true,
163            "forwarding": false,
164            "address": {
165              "ip": "2001:db8:1000:aaaa::2/64"
166            }
167          }
168        },
169        {
170          "name": "GigabitEthernet0/14/0",
171          "description": "<![CDATA[\"To ISP B\"]]>",
172          "enabled": true,
173          "ipv4": {
174            "enabled": true,
175            "forwarding": false,
176            "address": {
177              "ip": "100.64.0.49/30"
178            }
179          },
180          "ipv6": {
181            "enabled": true,
182            "forwarding": false,
183            "address": {
184              "ip": "2001:db8:9999:ffff::2/64"
185            }
186          }
187        },
188        {
189          "name": "GigabitEthernet0/15/0",
190          "enabled": true,
191          "ipv4": {
192            "enabled": true,
193            "forwarding": false,
194            "address": {
195              "ip": "10.255.255.19/24"
196            }
197          }
198        }
199      ]
200    },
201    "http-config": {
202      "restconf": {
203        "enable": true
204      },
205      "authentication": {
206        "auth-type": "none"
207      }
208    },
209    "prefix-list-config": {
210      "prefix-lists": {
211        "list": [
212          {
213            "name": "EXPORT_IPv4",
214            "description": "<![CDATA[\"IPv4 Routes to Export\"]]>",
215            "rules": {
216              "rule": [
217                {
218                  "sequence": 10,
219                  "action": "permit",
220                  "prefix": "192.0.2.0/24"
221                }
222              ]
223            }
224          },
225          {
226            "name": "EXPORT_IPv6",
227            "description": "<![CDATA[\"IPv6 Routes to Export\"]]>",
228            "rules": {
229              "rule": [
230                {
231                  "sequence": 10,
232                  "action": "permit",
233                  "prefix": "2001:db8:a100:1005::/64"
234                }
235              ]
236            }
237          }
238        ]
239      }
240    },
241    "route-table-config": {
242      "static-routes": {
243        "route-table": [
244          {
245            "name": "ipv4-VRF:0",
246            "address-family": "ipv4",
247            "ipv4-routes": {
248              "route": [
249                {
250                  "destination-prefix": "192.0.2.0/24",
251                  "next-hop": {
252                    "hop": [
253                      {
254                        "hop-id": 1,
255                        "local": true
256                      }
257                    ]
258                  }
259                }
260              ]
261            }
262          },
263          {
264            "name": "ipv6-VRF:0",
265            "address-family": "ipv6",
266            "ipv6-routes": {
267              "route": [
268                {
269                  "destination-prefix": "2001:db8:a100:1005::/64",
270                  "next-hop": {
271                    "hop": [
272                      {
273                        "hop-id": 1,
274                        "local": true
275                      }
276                    ]
277                  }
278                }
279              ]
280            }
281          }
282        ]
283      }
284    }
285  }
286}