Browse Source

Cleanup nat64 references

master
Nico Schottelius 4 years ago
parent
commit
09a15b6c25
  1. 2
      p4app/nat64.json
  2. 38
      p4app/static-mapping.sh

2
p4app/static-mapping.json → p4app/nat64.json

@ -1,5 +1,5 @@
{
"program": "../p4src/static-mapping.p4",
"program": "../p4src/nat64.p4",
"switch": "simple_switch",
"compiler": "p4c",
"options": "--target bmv2 --arch v1model --std p4-16",

38
p4app/static-mapping.sh

@ -1,38 +0,0 @@
#!/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:61::${j} dev $dev lladdr 00:00:0a:00:00:0${j}"
mx h$i "ip -6 neigh add 2001:db8:62::${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…
Cancel
Save