ISP for my home…

master
LEdoian 3 weeks ago
parent 6c54b156e6
commit 22a1a23749

@ -0,0 +1,6 @@
#!/bin/sh
set -eu
. ./lib.shs
. machines/$mach/opts.shs
nsenter --wdns=$nethorror_root $namespaces "$@"

@ -0,0 +1,3 @@
#!/bin/false
namespaces="--net=./state/$mach/netns --mount=./state/$mach/mntns"

@ -0,0 +1,7 @@
#!/bin/sh
set -eu
. ./lib.shs
ensure_started
attach machines/$mach/setup.sh

@ -0,0 +1,27 @@
#!/bin/sh
set -eu
# typically: bring up the networks
ip link set dev lo up
# uplink
# glue networks for both AFs
ip addr add 100.64.224.2/30 dev up_ve
ip addr add 2a01:4f8:c0c:36b8:ffe0::2/126 dev up_ve
# (cg)nat: TODO as we are (1) lazy and (2) wishing for public IPv4 address anyway
#nft add table ip nat
#nft add chain ip nat postrouting type nat hook postrouting priority srcnat
#nft add rule oifname \"up_ve\" ip saddr TODO masquerade
ip link set dev up_ve up
ip route add default via 100.64.224.1 dev up_ve
ip route add default via 2a01:4f8:c0c:36b8:ffe0::1 dev up_ve
# network to my home
# TODO: make this PPP(oE) in the future?
# It's silly to think that I would be the first customer, but the IP addresses do not care :-P
ip addr add 100.64.225.1/30 dev home_ve
ip addr add 2a01:4f8:c0c:36b8:ffe1::1/126 dev home_ve
ip link set dev home_ve up
# low-key delegated prefix :-P
ip route add 2a01:4f8:c0c:36b8:ffe1::/80 via 2a01:4f8:c0c:36b8:ffe1::2 dev home_ve
# TODO: DHCPv6 or IPv6CP

@ -0,0 +1,11 @@
#!/bin/sh
set -eu
. ./lib.shs
. machines/$mach/opts.shs
setup_statedir
unshare $namespaces /bin/true # just create the namespaces
veth_to_bridge up_ve homeisp_up
veth_to_bridge home_ve home_up

@ -16,3 +16,9 @@ ip addr add fe80:ff01::1/64 dev vps_ve scope link
ip link set dev vps_ve up
ip route add 2a01:4f8:c0c:36b8:ff01::/80 via fe80:ff01::2 dev vps_ve
# Home ISP
ip addr add 100.64.224.1/30 dev homeisp_ve
ip addr add 2a01:4f8:c0c:36b8:ffe0::1/126 dev homeisp_ve
ip link set dev homeisp_ve up
ip route add 100.64.224.0/20 via 100.64.224.2 dev homeisp_ve
ip route add 2a01:4f8:c0c:36b8:ffe0::/76 via 2a01:4f8:c0c:36b8:ffe0::2 dev homeisp_ve

@ -8,3 +8,5 @@ setup_statedir
unshare $namespaces /bin/true # just create the namespaces
veth_to_bridge vps_ve vpsuplink
veth_to_bridge homeisp_ve homeisp_up

@ -0,0 +1,5 @@
#!/bin/sh
set -eu
. ./lib.shs
make_bridge

@ -0,0 +1,5 @@
#!/bin/sh
set -eu
. ./lib.shs
make_bridge
Loading…
Cancel
Save