1

I'm running Linux and I know my gateway will always be 192.168.1.254 with MAC address aa:aa:aa:aa:aa:aa.

Is there any way I can instruct my machine to only ever use this MAC address for the gateway and ignore all ARP responses for this IP address?

Scott Pack
  • 15,097

2 Answers2

8

You can use arp to control the ARP tables.

arp -s 192.168.1.254 aa:aa:aa:aa:aa:aa

will statically map the IP to the MAC, bypassing ARP, and should do the trick.

gparent
  • 3,652
1

ARP has to do with ethernet<->ip mapping, not default gateway setting.

After you set up static network address/gateway (link) you can add a static arp entry for your gateway (link)

arp -i <your interface> -s <ip.of.the.gateway> <mac:of:the:gateway>
arp -i eth0 -s 192.168.1.254 aa:aa:aa:aa:aa:aa
mulaz
  • 10,962