AP for clients…
parent
8a516f5307
commit
8bfa034f33
@ -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,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
. ./lib.shs
|
||||
|
||||
# typically: bring up the networks
|
||||
ip link set dev lo up
|
||||
|
||||
setup_for_router
|
||||
|
||||
# ISP network
|
||||
ip addr add 10.0.0.2/24 dev isp_ve
|
||||
# NAT: use 10.0.0.0/24 inside the network and 192.168.0.1/24 for the client network
|
||||
nft add table ip nat
|
||||
nft add chain ip nat postrouting { type nat hook postrouting priority srcnat \; }
|
||||
nft add rule ip nat postrouting oifname \"isp_ve\" ip saddr 192.168.0.0/24 masquerade
|
||||
ip link set dev isp_ve up
|
||||
ip route add default via 10.0.0.1 dev isp_ve
|
||||
|
||||
# network for clients
|
||||
ip addr add 192.168.0.1/24 dev cli_vwlan
|
||||
# No IPv6 at public spaces lol
|
||||
ip link set dev cli_vwlan up
|
||||
|
||||
# TODO: DHCP server!
|
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
. ./lib.shs
|
||||
. machines/$mach/opts.shs
|
||||
|
||||
setup_statedir
|
||||
|
||||
unshare $namespaces /bin/true # just create the namespaces
|
||||
|
||||
veth_to_bridge isp_ve loc1_ap ve_loc1ap_ap
|
||||
# TODO: make it virt_wifi (need to read iproute2 src…)
|
||||
veth_to_bridge cli_vwlan loc1_cli ve_loc1_wifi
|
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
. ./lib.shs
|
||||
make_bridge
|
Loading…
Reference in New Issue