Cisco – Lab – IPv4 anycast vlan and host interactions for OSPF

anycastcisco

I am trying to wrap my head around anycast on ipv4 and then ipv6. I am trying to figure out how to properly setup anycast on a multilayer switch and haven't found any good documentation on how it plays out.

Scenerio: Corp network with datacenter and core on a catalyst 6500 series, Uplink2 with ip 10.0.50.1/29 connected to corp master server for DNS/Authentication/TFTP with 10.0.50.2/29 as an anycast address. VM host on a trunk with server ip of 10.0.10.2/24 on vlan2 for the datacenter would host a vm with a 2ndary dns/auth server that would attach to the anycast ip of 10.0.50.2 and using ispf routing values to have all clients/servers access it and then the master if it goes down.

The port the host is on would it need to be a layer 3 port or is there a way to handle it with a layer 2 trunk port? would the VM server or host system its self have to handle ospf to allow routing to properly be manipulated for that purpose? I had seen one article talk about adding the anycast to a lo interface on the DNS/Auth server and using ospf on it to allow for the any cast to work.

Rough Network diagram. All black servers would be ones I want to assign an anycast address to. Gi8/1 is currently a layer2 trunk attached to a linux Kvm server. gi5/2 is a layer 3 connected directly to the master server.

enter image description here

Best Answer

I'm not sure if I get your approach but most probably you're not doing it right.

Anycast is termination of the same IP address/subnet in multiple points in your network. For this the subnet in which the IP address is contained cannot be used for anything else than multicast - you need to be able to route it off multiple routers without breaking anything.

You'll need a dedicated anycast subnet that you may just put on top of your normal subnet. For instance, you configure the anycast address 10.99.50.2 as a secondary address on the host 10.0.50.2. On another host 10.0.60.2 a bit further down the road you also configure 10.99.50.2 as secondary address. Now, on the router 10.0.50.1 (close to 10.0.50.2) you add an IP address 10.99.50.1/24 to the same interface it's got 10.0.50.1 bound on. For the router 10.0.60.1 (close to 10.0.60.2) you do the exact same thing.

The result is that clients using the router 10.0.50.1 will be routed to the host with the primary address 10.0.50.2 and clients using the router 10.0.60.1 will end up on the host with the primary address 10.0.60.2.

In a corporate network, it is usually easier to use split-brain DNS and resolve the DNS name depending on location to point to the nearest server.

On the Internet, anycast is more practical than split-brain DNS as you've got no control over which DNS server your clients use.