DEV Community

IPYE
IPYE

Posted on

Cisco IOS XE: BGP Address-Family Setup for a Free /48

Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end.

On IOS XE, IPv6 BGP lives inside an address family, and the IPv4 defaults from decades of older configurations still apply unless you turn them off. Getting the address-family structure right from the start saves confusing half-working sessions later. This guide announces a free IPv6 /48 from IPYE on IOS XE, on a physical router or a CSR1000v or Catalyst 8000V virtual router. The examples use 2001:db8:100::/48, AS64496, and an upstream AS64511 at 2001:db8:0:1::1.

Enable routing and address the interfaces

ipv6 unicast-routing
ipv6 cef
!
interface GigabitEthernet1
 ipv6 address 2001:db8:0:1::2/64
 no ipv6 redirects
 no ipv6 unreachables
!
interface Loopback0
 ipv6 address 2001:db8:100::1/128
!
ipv6 route 2001:db8:100::/48 Null0
Enter fullscreen mode Exit fullscreen mode

no ipv6 unreachables on the upstream-facing interface stops the router from generating ICMPv6 unreachables toward the Internet. The Null0 route drops traffic for unused parts of the /48 and gives the network statement a route to match.

Prefix lists and route maps

ipv6 prefix-list OWN-OUT seq 10 permit 2001:db8:100::/48
!
ipv6 prefix-list UPSTREAM-IN seq 10 deny 2001:db8:100::/48 le 128
ipv6 prefix-list UPSTREAM-IN seq 20 permit ::/0 le 48
!
route-map UPSTREAM-OUT permit 10
 match ipv6 address prefix-list OWN-OUT
Enter fullscreen mode Exit fullscreen mode

The BGP process

router bgp 64496
 bgp router-id 192.0.2.10
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 2001:db8:0:1::1 remote-as 64511
 neighbor 2001:db8:0:1::1 description upstream
 !
 address-family ipv6 unicast
  network 2001:db8:100::/48
  neighbor 2001:db8:0:1::1 activate
  neighbor 2001:db8:0:1::1 prefix-list UPSTREAM-IN in
  neighbor 2001:db8:0:1::1 route-map UPSTREAM-OUT out
  neighbor 2001:db8:0:1::1 maximum-prefix 250000 90 restart 15
 exit-address-family
Enter fullscreen mode Exit fullscreen mode

no bgp default ipv4-unicast stops every new neighbour from being activated for IPv4 automatically. For an IPv6 neighbour, an IPv4 activation is harmless but pointless, and it clutters show output. The IPv6 family is activated explicitly, which is the habit you want.

maximum-prefix 250000 90 restart 15 warns at ninety percent, tears down the session at the limit, and retries after fifteen minutes.

A rollback plan

IOS XE has no confirmed commit in the classic CLI, but you can get close. Save a checkpoint first, then apply:

archive
 path flash:archive
!
archive config
configure terminal revert timer 5
Enter fullscreen mode Exit fullscreen mode

configure terminal revert timer 5 opens a configuration session that reverts to the archived configuration after five minutes unless you run configure confirm. An older fallback is reload in 10, then reload cancel once you are sure. Either is better than hoping.

Verify

show bgp ipv6 unicast summary
show bgp ipv6 unicast neighbors 2001:db8:0:1::1 advertised-routes
show bgp ipv6 unicast 2001:db8:100::/48
show ipv6 route 2001:db8:100::/48
Enter fullscreen mode Exit fullscreen mode

After changing a policy, apply it without resetting the session using clear bgp ipv6 unicast 2001:db8:0:1::1 soft out. A hard clear drops the session and every route with it.

Protect the control plane

Add an infrastructure ACL on the upstream interface that allows TCP 179 only from 2001:db8:0:1::1, plus the ICMPv6 types you need: packet-too-big, time exceeded, and neighbour discovery. A short ACL like this is enough for one router. Larger networks often add control-plane policing on top.

ipv6 access-list EDGE-IN
 permit tcp host 2001:db8:0:1::1 host 2001:db8:0:1::2 eq bgp
 permit tcp host 2001:db8:0:1::1 eq bgp host 2001:db8:0:1::2
 permit icmp any any packet-too-big
 permit icmp any any nd-na
 permit icmp any any nd-ns
 deny ipv6 any host 2001:db8:0:1::2
 permit ipv6 any any
Enter fullscreen mode Exit fullscreen mode

Applying this with ipv6 traffic-filter EDGE-IN in still lets transit traffic to your /48 pass, while it protects the router's own address. Note that the deny line also blocks SSH and ping to the uplink address from outside, which is usually what you want. Manage the router through the loopback or a dedicated management network instead, and add an explicit permit above the deny if you need echo requests for monitoring.

Save and document

When the session is up and confirmed, copy running-config startup-config, then copy the configuration off the box to version control. A plain show running-config | section router bgp is short enough to review by eye in a pull request, and that is where mistakes in a prefix list are easiest to spot.

RPKI and LOA

With the /48 on IPYE's ARIN or APNIC accounts, the ROA is created automatically for your origin ASN. For the upstream's filter request, download the Letter of Authorization from the IPYE portal.

Do this next

Claim your free /48, apply the configuration inside a revert timer, and check the advertised routes before you confirm. Questions: ipye@turnel.com.

About IPYE

IPYE (https://ipye.com) leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. ASN and region changes apply automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS; WHOIS is editable on IPv6 /44 and larger. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. Claim your free /48: https://my.ipye.com/products/ipv6-rental. Questions: ipye@turnel.com.

Disclosure: I run IPYE

Top comments (0)