From 7ec3c99ca3f4e5ca37c3a80daadcc2f42404be13 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 20 Feb 2025 13:57:12 +0100 Subject: [PATCH] We routing now (lol) --- lib.shs | 13 +++++++++++++ machines/hispgw/setup.sh | 4 ++++ machines/iana/setup.sh | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/lib.shs b/lib.shs index 72282e1..c954ae4 100644 --- a/lib.shs +++ b/lib.shs @@ -18,6 +18,19 @@ ensure_started() { test -e state/$mach/$netns || machines/$mach/start.sh } +setup_for_router4() { + sysctl net.ipv4.conf.all.forwarding=1 +} + +setup_for_router6() { + sysctl net.ipv6.conf.all.forwarding=1 +} + +setup_for_router() { + setup_for_router4 + setup_for_router6 +} + attach() { machines/$mach/attach.sh "$@" } diff --git a/machines/hispgw/setup.sh b/machines/hispgw/setup.sh index aae12f0..f901036 100755 --- a/machines/hispgw/setup.sh +++ b/machines/hispgw/setup.sh @@ -1,9 +1,13 @@ #!/bin/sh set -eu +. ./lib.shs + # typically: bring up the networks ip link set dev lo up +setup_for_router + # uplink # glue networks for both AFs ip addr add 100.64.224.2/30 dev up_ve diff --git a/machines/iana/setup.sh b/machines/iana/setup.sh index be946f1..3a748ef 100755 --- a/machines/iana/setup.sh +++ b/machines/iana/setup.sh @@ -1,9 +1,13 @@ #!/bin/sh set -eu +. ./lib.shs + # typically: bring up the networks ip link set dev lo up +setup_for_router + # some random address in the internet :-P ip link add somewhere type dummy ip addr add 100.111.0.1/32 dev somewhere