I would like to add ARP entry for an entire subnet (10.50.0.0/16).
I tried : arp -v -i p4p1 -s 10.50.0.0 MAC_OF_P4P2 netmask 255.255.0.0 pub
But the command returns:
arp: SIOCSARP()
SIOCSARP: Invalid argument
No problem if I add one by one: arp -v -i p4p1 -s 10.50.0.1 MAC_OF_P4P2
Is there any way to do what I want ?
Something like: arp -v -i p4p1 -s 10.50.0.0/16 MAC_OF_P4P2
Story:
I have 3 interfaces: eth0, p4p1 and p4p2.
p2p1 and p2p2 are connected through a device but let's say like a wire.
We have multiple servers with A.B.x.x in the network that is connected to Eth0.
From the system, I would like to access to A.B.x.x:
- Through
Eth0directly:ping A.B.X.Xno problem, it does automatically
- Through
p2p1->external device/wire->p2p2and then redirect toEth0:ping 10.50.X.X
In that case, I need to create virtual IPs 10.50.0.0/16 that will be same as A.B.0.0/16 but through the p4p* interfaces.
Packets need to keep 10.50.x.x as IP source/destination, only when it reaches eth0, the IP will be translated to A.B.X.X.
Let's do it step by step.
- I route
10.50.0.0/16to my interfacep4p1:ip route add 10.50.0.0/16 dev p2p1.

