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 connected to corp master server for DNS/Authentication/TFTP with as an anycast address. VM host on a trunk with server ip of on vlan2 for the datacenter would host a vm with a 2ndary dns/auth server that would attach to the anycast ip of 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

  • You need to provide us with a network diagram, the network devices, and the network device configurations. Also, anycast is not explicitly configured on a network device. You use the same network in multiple places, and the routing protocol will only populate the routing table with the closest (by the routing protocol). When that network goes down, the next closest will be placed in the routing table.
    – Ron Maupin
    Mar 4, 2018 at 22:10
  • That's not really how to use anycast. For anycast, you would have the servers with the same IP addresses, meaning that you would have the same network in two places. If hosts are on one of the networks, they could never reach a different network with the same network address. In this case, I would simply have multiple DNS servers configured in the hosts.
    – Ron Maupin
    Mar 6, 2018 at 20:34
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Apr 1, 2018 at 22:15

1 Answer 1


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 as a secondary address on the host On another host a bit further down the road you also configure as secondary address. Now, on the router (close to you add an IP address to the same interface it's got bound on. For the router (close to you do the exact same thing.

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

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.

  • so the host usually have directly connected 2ndary ip, that makes sense. in this case i was trying to have the master and 2ndary on the same switch and set the master to a further value in ospf. would it take a layer 3 port on both hosts to allow that to work on the same switch? or is it possible to set the ospf value on a layer2 port to allow for fallover etc?
    – Kendrick
    Mar 6, 2018 at 23:43
  • "is it possible to set the ospf value on a layer2 port to allow for fallover etc?" Routing happens at layer-3, not layer-2. At layer-2, frames are delivered directly from host-to-host by layer-2 address, and the switches are transparent devices.
    – Ron Maupin
    Mar 7, 2018 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.