master-thesis/bin/set_ipv4_neighbor.sh
2019-08-04 09:08:17 +02:00

16 lines
314 B
Bash
Executable file

#!/bin/sh
# eth1 / nsg
remote_mac=f8:f2:1e:41:44:9c
# enp2s0f1 / esprimo
remote_mac=f8:f2:1e:09:62:d1
intf=enp2s0f1
set -x
for addr in $(seq 1 66); do
hwaddr=$(printf "%0.2d" $addr)
sudo ip neighbor del 10.0.0.$addr dev ${intf}
sudo ip neighbor add 10.0.0.$addr lladdr $remote_mac dev ${intf}
done