Sign up and stay connected to your favorite communities.

sign uplog in
Posted by
Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
1 year ago

Fun with Windows - BGP

Need a another router for your BGP lab and can't be annoyed to create another router in VIRL/GNS3 or plug in another router for your lab? Never feel fear, use Windows instead!

Yes Windows Server actually has a fairly strong networking stack that can do static routes, RIP, and BGP. For fun lets do a BGP peering with a Windows 2016 server via powershell and a Cisco router.

First things first we will need to install the Remote Access and Routing and Remote Access role.

PS C:\>Install-WindowsFeature RemoteAccess
PS C:\>Install-WindowsFeature RSAT-RemoteAccess-PowerShell
PS C:\>Install-WindowsFeature Routing

Next we enable LAN routing on the system.

PS C:\> Install-RemoteAccess -VpnType RoutingOnly

Now we move on the BGP configuration, first we create a BGP router, the BGP identifer is the router-id, I tend to use the IP address of the box. The LocalASN is the AS number for the router.

PS C:\> Add-BgpRouter -BgpIdentifier -LocalASN 100

Then we add the peer's IP address, AS number, and give it a name.

PS C:\> Add-BgpPeer -LocalIPAddress -PeerIPAddress -PeerASN 200 -Name CSR01

On the Cisco router we'll add some loopbacks, setup BGP, and redistribute the interfaces into it

CSR01(config)#interface Loopback0
CSR01(config-if)# ip address
CSR01(config-if)#interface Loopback1
CSR01(config-if)# ip address
CSR01(config-if)#interface Loopback2
CSR01(config-if)# ip address
CSR01(config-if)#interface Loopback3
CSR01(config-if)# ip address
CSR01(config)#router bgp 200
CSR01(config-router)# bgp log-neighbor-changes
CSR01(config-router)# redistribute connected
CSR01(config-router)# neighbor remote-as 100

On the Windows side we'll advertise 5 networks, one nice thing about Windows is that the networks don't need to exist on the system so you can just add networks without creating interfaces.

PS C:\> Add-BgpCustomRoute -network

PS C:\> Add-BgpCustomRoute -network

PS C:\> Add-BgpCustomRoute -network

PS C:\> Add-BgpCustomRoute -network

PS C:\> Add-BgpCustomRoute -network

Just for fun we'll make the first 4 routes a summary

PS C:\> Add-BgpRouteAggregate -Prefix -SummaryOnly Enabled

We can see the Cisco has learned the and the left over

CSR01(config-router)#do sh ip bgp
BGP table version is 18, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>                  0         32768 ?
 *>                  0         32768 ?
 *>                           0 100 i
 *>                           0 100 i
 *>                  0         32768 ?
 *>                  0         32768 ?
 *>                  0         32768 ?
 *>                  0         32768 ?
 *>                  0         32768 ?

Windows can do show commands as well though it uses get

PS C:\> Get-BgpRouter

RoutingDomain            : 
BgpIdentifier            :
LocalASN                 : 100
CompareMEDAcrossASN      : False
DefaultGatewayRouting    : False
IPv6Routing              : Disabled
LocalIPv6Address         : 
PeerName                 : {CSR01}
PolicyName               : 
TransitRouting           : Disabled
RouteReflector           : Disabled
ClusterId                : 
ClientToClientReflection : 

PS C:\> Get-BgpPeer

PeerName LocalIPAddress PeerIPAddress PeerASN OperationMode ConnectivityStatus
-------- -------------- ------------- ------- ------------- ------------------
CSR01  200     Mixed         Connected         

We can see what the Windows side is learning like so.

PS C:\> Get-BgpRouteInformation

DestinationNetwork NextHop      LearnedFromPeer State LocalPref MED
------------------ -------      --------------- ----- --------- --- CSR01           Best            0                                   Best       CSR01           Best            0 CSR01           Best            0 CSR01           Best            0 CSR01           Best            0 CSR01           Best            0  

We can also view the Windows routing table as well.

PS C:\> get-netroute -NextHop | Sort-Object

ifIndex DestinationPrefix                              NextHop                                  RouteMetric PolicyStore
------- -----------------                              -------                                  ----------- -----------
5                                                               0 ActiveStore
5                                                              0 ActiveStore
5                                                              0 ActiveStore
5                                                              0 ActiveStore
5                                                              0 ActiveStore
5                                                                0 ActiveStore
96% Upvoted
This thread is archived
New comments cannot be posted and votes cannot be cast
Sort by
1 point1 year ago

Should also be noted that it can be installed and configured using the server manager as well. Under the remote access role and then the routing feature IIRC. It's pretty similar, but I'm almost certain that you'd have more options using the PS method.

Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
Original Poster4 points1 year ago

To be honest I just didn't feel like doing screenshots :)

1 point1 year agoedited 1 year ago

That's actually pretty neat! Wouldn't have thought of it. Do you know if it works in 2012 as well or only 2016?

e/Excellent, I have a hardware lab at work with some '12 servers I'll have to play around with. Thanks for all the info folks.

2 points1 year ago

It's available in 2012 and 2008.

Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
Original Poster2 points1 year ago

Yup it is is 2012 R2 as well.

4 points1 year ago

never feel, use windows instead

Yeah using Windows does that to you

Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
Original Poster1 point1 year ago


1 point1 year ago

Awesome! Nice Tutorial. Thank You!

If I ever come across an environment actually using windows as a BGP-speaking router, I'm blaming you.

This is both awesome and horribly grotesque all at the same time.

Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
Original Poster3 points1 year ago

Just count yourself lucky I didn't do the Windows VXLAN post :)

1 point1 year ago

For fun, I'm going to pretend that your BGP-speaking Windows instance is installed on a UCS-E in the BGP peer (I know it's a CSR, but still).

Meow 馃悎馃悎Meow 馃惐馃惐 Meow Meow馃嵑馃悎馃惐Meow A+!
Original Poster1 point1 year ago

Wouldn't be the first time I did something weird with UCS-E

1 point1 year ago

This looks pretty cool. Comment so I can easily find it later. Thanks Cat-guy.

1 point1 year ago

There's also a save button

1 point1 year ago


1 point1 year ago

I see it now on the top. Nice! How long has that been there? I'm a newb.

1 point1 year ago

As long as I've been using reddit and you've been on longer than me!

1 point1 year ago

I'm old though, so...

Community Details





Create Post

r/ccna Rules

No posting of illegal materials
No posting of braindumps
Be courteous and helpful
Don't ask others to complete your labs
Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies.Learn More.