Remove IPv6 since we will use Re6st

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-06-11 12:03:26 +02:00
parent fae4564b9d
commit af9649d1ce
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -24,8 +24,6 @@ function reset() {
pkill -e babeld pkill -e babeld
rm -rv /tmp/switch* /tmp/ns* rm -rv /tmp/switch* /tmp/ns*
ip route delete 172.17.0.0/16 ip route delete 172.17.0.0/16
ip -6 route delete 2a0c:700:3012:3::1:0/112
ip -6 route delete 2a0c:700:3012:3::2:0/112
nft flush ruleset nft flush ruleset
} }
@ -41,7 +39,6 @@ sudo vde_plug --daemon vde:///tmp/ext tap://vde0
sudo ip link set dev vde0 address 02:00:00:00:00:00 sudo ip link set dev vde0 address 02:00:00:00:00:00
sudo ip link set dev vde0 up sudo ip link set dev vde0 up
sudo ip address add 10.2.1.1/30 dev vde0 sudo ip address add 10.2.1.1/30 dev vde0
sudo ip address add 2a0c:700:3012:3::ff:0/127 dev vde0
# Setup NAT # Setup NAT
nft -f $dir/firewall/nat.conf nft -f $dir/firewall/nat.conf
@ -63,9 +60,7 @@ for i in 1 2 3 4; do
tmux send-keys -t ns$i "ip link set dev vde0 address 02:00:00:00:00:01" Enter tmux send-keys -t ns$i "ip link set dev vde0 address 02:00:00:00:00:01" Enter
tmux send-keys -t ns$i "ip link set dev vde0 up" Enter tmux send-keys -t ns$i "ip link set dev vde0 up" Enter
tmux send-keys -t ns$i "ip address add 10.2.1.2/30 dev vde0" Enter tmux send-keys -t ns$i "ip address add 10.2.1.2/30 dev vde0" Enter
tmux send-keys -t ns$i "ip address add 2a0c:700:3012:3::ff:1/127 dev vde0" Enter
tmux send-keys -t ns$i "ip route add default via 10.2.1.1 dev vde0 proto kernel" Enter tmux send-keys -t ns$i "ip route add default via 10.2.1.1 dev vde0 proto kernel" Enter
tmux send-keys -t ns$i "ip -6 route add default via 2a0c:700:3012:3::ff:0 dev vde0 proto kernel" Enter
tmux send-keys -t ns$i "echo \"interface vde0 type wired\" >> /tmp/ns$i/babeld.conf" Enter tmux send-keys -t ns$i "echo \"interface vde0 type wired\" >> /tmp/ns$i/babeld.conf" Enter
tmux send-keys -t ns$i "echo \"redistribute metric 256\" >> /tmp/ns$i/babeld.conf" Enter tmux send-keys -t ns$i "echo \"redistribute metric 256\" >> /tmp/ns$i/babeld.conf" Enter
fi fi
@ -82,7 +77,6 @@ for i in 1 2 3; do
tmux send-keys -t ns$i "ip link set dev vde1 address 02:00:00:00:01:0$i" Enter tmux send-keys -t ns$i "ip link set dev vde1 address 02:00:00:00:01:0$i" Enter
tmux send-keys -t ns$i "ip link set dev vde1 up" Enter tmux send-keys -t ns$i "ip link set dev vde1 up" Enter
tmux send-keys -t ns$i "ip address add 172.17.1.$i/32 dev vde1" Enter tmux send-keys -t ns$i "ip address add 172.17.1.$i/32 dev vde1" Enter
tmux send-keys -t ns$i "ip address add 2a0c:700:3012:3::1:$i/128 dev vde1" Enter
tmux send-keys -t ns$i "echo \"interface vde1 type wired\" >> /tmp/ns$i/babeld.conf" Enter tmux send-keys -t ns$i "echo \"interface vde1 type wired\" >> /tmp/ns$i/babeld.conf" Enter
done done
@ -93,18 +87,15 @@ for i in 2 3 4; do
tmux send-keys -t ns$i "ip link set dev vde2 address 02:00:00:00:02:0$i" Enter tmux send-keys -t ns$i "ip link set dev vde2 address 02:00:00:00:02:0$i" Enter
tmux send-keys -t ns$i "ip link set dev vde2 up" Enter tmux send-keys -t ns$i "ip link set dev vde2 up" Enter
tmux send-keys -t ns$i "ip address add 172.17.2.$i/32 dev vde2" Enter tmux send-keys -t ns$i "ip address add 172.17.2.$i/32 dev vde2" Enter
tmux send-keys -t ns$i "ip address add 2a0c:700:3012:3::2:$i/128 dev vde2" Enter
tmux send-keys -t ns$i "echo \"interface vde2 type wired\" >> /tmp/ns$i/babeld.conf" Enter tmux send-keys -t ns$i "echo \"interface vde2 type wired\" >> /tmp/ns$i/babeld.conf" Enter
done done
ip route add 172.17.0.0/16 via 10.2.1.2 ip route add 172.17.0.0/16 via 10.2.1.2
ip -6 route add 2a0c:700:3012:3::1:0/112 via 2a0c:700:3012:3::ff:1
ip -6 route add 2a0c:700:3012:3::2:0/112 via 2a0c:700:3012:3::ff:1
# Restrict HTTP transport on node 2 # Restrict HTTP transport on node 2
tmux send-keys -t ns2 "nft -f $dir/firewall/restrict-http.conf" Enter tmux send-keys -t ns2 "nft -f $dir/firewall/restrict-http.conf" Enter
# Put a higher metric for node 3, to enforce babel to choose node 2 # Put a higher metric for node 3, to enforce babel to choose node 2
tmux send-keys -t ns4 "echo \"in neigh fe80::ff:fe00:202\" metric 512" echo "in neigh fe80::ff:fe00:202 metric 512" > /tmp/ns4/babeld.conf
for i in 1 2 3 4; do for i in 1 2 3 4; do
tmux send-keys -t ns$i "touch /etc/babeld.conf && mount --bind /tmp/ns$i/babeld.conf /etc/babeld.conf" Enter tmux send-keys -t ns$i "touch /etc/babeld.conf && mount --bind /tmp/ns$i/babeld.conf /etc/babeld.conf" Enter