BGP - using public IPs with private ASes
It is possible for an enterprise to have purchased public IPv4 or IPv6 addresses and to advertise those addresses using BGP, while at the same time maintaining a private ASN at the edge of the network. In order to make this work, close coordination with the ISP is necessary. Specifically:
- The enterprise can lease a block of public IP addresses from the ISP.
- The ISP assigns a private ASN to the enterprise.
- The enterprise uses BGP to advertise these IP addresses to the ISP using a BGP session with the ISP’s router.
- On the ISP’s side, the BGP session would be established with the enterprise’s private ASN. The ISP will then “strip” this private ASN when advertising the routes to the public Internet, replacing the private AS number with its own public ASN. Thus the ISP becomes the destination AS for the enterprise’s public IPs.
This setup allows the enterprise to manage its public IP space and to control how traffic flows to and from its network while allowing the ISP to take care of the BGP peering on the public internet.
However, in this setup, the enterprise won’t be able to perform certain BGP functions, such as multi-homing with different ISPs, without coordination from its ISP. This is because it does not own the public ASN used to advertise its IPs and cannot directly control how routes are advertised to the rest of the Internet.
It is also possible to use private ASNs with private IPs.