Windows Server BGP
BGP routing on Windows Server 2019
Running BGP routing on Windows Server 2019 without third-party software is possible. Dynamic routing protocols like Border Gateway Protocol (BGP) are crucial for managing large networks. In this post, we will be diving straight into the configuration process of BGP on Microsoft Windows Server 2019, without going into theory as it is assumed that you’re already familiar with the concepts of BGP. You will find the details and arguments of the below commands in the RemoteAccess section of Microsoft documentation.
Installing BGP on Windows Server
The process of configuring BGP on Windows Server 2019 may not be well-documented, but with this guide, you’ll be able to set it up with ease. Before you begin, you’ll need to install Network Features on your Windows Server to enable routing-to-the-host and improve your network’s efficiency. This can be done by running the following commands:
Install-WindowsFeature RemoteAccess
Install-WindowsFeature RSAT-RemoteAccess-PowerShell
Install-WindowsFeature Routing
Install-RemoteAccess -VpnType RoutingOnly
Configure ASN and RID
Next, you’ll need to configure the Autonomous System Number (ASN) and Router ID (RID) on your Windows Server. This can be done by running the following command:
Add-BgpRouter -BgpIdentifier 10.10.13.111 -LocalASN 100
Configure a BGP peer
You’ll also need to add a BGP peer to your Windows Server. This can be done by running the following command:
Add-BgpPeer -LocalIPAddress 10.10.13.111 -PeerIPAddress 10.10.13.171 -PeerASN 200 -Name CSR01
Originate and announce BGP routes
Once you’ve added a BGP peer, you’ll need to announce routes on your Windows Server for routing-to-the-host. This can be done by running the following commands:
Add-BgpCustomRoute -network 172.16.0.0/24 Add-BgpCustomRoute -network 172.16.1.0/24 Add-BgpCustomRoute -network 172.16.2.0/24 Add-BgpCustomRoute -network 172.16.3.0/24 Add-BgpCustomRoute -network 172.16.4.0/24
Summarise prefixes
You can also summarize prefixes, set policies for peers, and even explore advanced examples like using the Test-Connection command to automatically set the BGP Identifier. Below are some examples:
Summarise prefixes
Add-BgpRouteAggregate -Prefix 172.16.0.0/22 -SummaryOnly Enabled
Policy for peers
Add-BgpRoutingPolicy -Name RoutePolicy -MatchPrefix 192.168.1.0/24 -PolicyType ModifyAttribute -AddCommunity 100:1001 -NewLocalPref 500 Add-BgpRoutingPolicyForPeer -PeerName CSR01 -PolicyName RoutePolicy -Direction Ingress Get-BgpRouteInformation -Network 192.168.1.0/24 | fl
Advanced examples
$ipV4 = Test-Connection -ComputerName (hostname) -Count 1 | Select IPV4Address Add-BgpRouter -BgpIdentifier $ipV4 -LocalASN 65534 Add-BgpPeer -LocalIPAddress $ipV4 -PeerIPAddress 10.10.10.10 -PeerASN 64512 -Name Switch Add-BgpCustomRoute -network 10.21.123.10/32
Conclusion
In conclusion, this article has shown that it is now possible to do routing-to-the-host on Windows Server 2019 using BGP as the dynamic routing protocol. By following the steps outlined in this post, you’ll be able to configure routing on your Windows Server host, allowing for better management of your network. This guide provides you with a comprehensive understanding of how to set up BGP on Windows Server 2019 and improve your network’s efficiency.
I hope that you find this article helpful, do not hesitate to check the wansec blog for more interesting articles.
I have been looking for an article like this for months; thank you so much for this great article. This must be one of the only article about BGP on Microsoft Windows Server and I have been able to implement something on my test system. Keep up the great work!!!