create P4 basis + smaller updates
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
7f904bdcef
commit
b6bd281c3a
8 changed files with 151 additions and 3 deletions
37
p4app/static-mapping.sh
Normal file
37
p4app/static-mapping.sh
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
# cleanup
|
||||
for i in 1 2 3 4; do
|
||||
mx h$i "ip addr flush dev $dev"
|
||||
done
|
||||
|
||||
# host 1/2+42 need NDP for reaching themselves
|
||||
for i in 1 2; do
|
||||
dev="h$i-eth0"
|
||||
# add and enable ipv6
|
||||
mx h$i "sysctl net.ipv6.conf.{lo,h$i-eth0}.disable_ipv6=0"
|
||||
mx h$i "ip addr add 2001:db8:6::$i/64 dev $dev"
|
||||
mx h$i "ip -6 route add default via 2001:db8:6::42"
|
||||
|
||||
# add neighbors
|
||||
for j in 1 2 42; do
|
||||
mx h$i "ip -6 neigh add 2001:db8:6::${j} dev $dev lladdr 00:00:0a:00:00:0${j}"
|
||||
done
|
||||
done
|
||||
|
||||
# host 3/4 need ARP, also need access to .42 (virtual IP)
|
||||
for i in 3 4; do
|
||||
dev="h$i-eth0"
|
||||
mx h$i "ip addr add 10.0.0.$i/24 dev $dev"
|
||||
|
||||
# add arp
|
||||
for j in 1 2 42; do
|
||||
mx h$i "ip neigh add 10.0.0.${j} dev $dev lladdr 00:00:0a:00:00:${j}"
|
||||
done
|
||||
done
|
||||
|
||||
for i in 1 2 3 4; do
|
||||
mx h$i "ip neigh show"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue