Update viwib setup script to retain ipv4 and default settings
This commit is contained in:
parent
24521e82dd
commit
7e45b4fba8
2 changed files with 24 additions and 30 deletions
|
@ -5,7 +5,7 @@ if [ $# -ne 2 ]; then
|
|||
echo "$0 ip-address interface"
|
||||
echo " ip-address: where to find the OpenWRT device"
|
||||
echo " interface: which interface is the LTE device"
|
||||
echo " Usually eth1 on VIIRB, eth3 on PIB"
|
||||
echo " Usually eth1 on VIIRB, VIWIB eth3 on PIB"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -55,28 +55,37 @@ fi
|
|||
|
||||
cat <<EOF | ssh -t "root@${viwib_ip}"
|
||||
set -x
|
||||
# Setup lan to also retrieve an ip address via dhcp
|
||||
|
||||
# Adjust LAN to be IPv6 only
|
||||
uci delete network.lan.ipaddr
|
||||
uci delete network.lan.netmask
|
||||
# Check connection - otherwise abort
|
||||
ping -c5 ungleich.ch || exit 1
|
||||
|
||||
# 1. install packages
|
||||
# update the sources
|
||||
opkg update
|
||||
|
||||
# install packages: wireguard + gui
|
||||
opkg install luci-app-wireguard luci-proto-wireguard
|
||||
|
||||
|
||||
# DO NOT Adjust LAN to be IPv6 only
|
||||
# uci delete network.lan.ipaddr
|
||||
# uci delete network.lan.netmask
|
||||
|
||||
uci set network.lan.ip6addr='${my_lan_ip}/64'
|
||||
|
||||
# Do not announce ULA - we have GUA
|
||||
uci delete network.globals.ula_prefix
|
||||
|
||||
# Setup Router Advertisements / remove IPv4 dhcp
|
||||
# Setup Router Advertisements / DO NOT remove IPv4 dhcp
|
||||
uci set dhcp.lan.ra='server'
|
||||
uci set dhcp.lan.dynamicdhcp='0'
|
||||
#uci set dhcp.lan.dynamicdhcp='0'
|
||||
#uci delete dhcp.@dnsmasq[0].authoritative
|
||||
# uci delete dhcp.lan.start
|
||||
# uci delete dhcp.lan.limit
|
||||
# uci delete dhcp.lan.leasetime
|
||||
|
||||
uci delete dhcp.@dnsmasq[0].authoritative
|
||||
|
||||
uci delete dhcp.lan.start
|
||||
uci delete dhcp.lan.limit
|
||||
uci delete dhcp.lan.leasetime
|
||||
|
||||
# We do stateless by default everywhere
|
||||
uci delete dhcp.lan.dhcpv6
|
||||
# We do stateless by default everywhere, however we can keep dhcp on ...
|
||||
# uci delete dhcp.lan.dhcpv6
|
||||
|
||||
# Fix DNS: make dnsmasq NOT use a resolv.conf
|
||||
# so that it only reads from our servers with DNS64 enabled
|
||||
|
@ -110,22 +119,9 @@ uci set wireless.default_radio0.ssid='IPv6 everywhere ${viwib_hostname}'
|
|||
# Ensure it is not disabled
|
||||
uci delete wireless.radio0.disabled
|
||||
|
||||
# Create temporary IPV4 CLIENT on LAN
|
||||
# This way we get Internet/upstream from the LAN port
|
||||
# Can we do this via IPv6 instead?
|
||||
# this breaks if multiple viwib are setup, as we have fake / wrong
|
||||
# dhcp server configurations.
|
||||
# easy solution: using two different networks...
|
||||
|
||||
uci commit
|
||||
|
||||
ping -c5 ungleich.ch || exit 1
|
||||
|
||||
# update the sources
|
||||
opkg update
|
||||
|
||||
# install wireguard + gui
|
||||
opkg install luci-app-wireguard luci-proto-wireguard
|
||||
|
||||
# VPN / Wireguard
|
||||
uci set network.wg0=interface
|
||||
|
@ -191,8 +187,6 @@ echo "Wireguard public key and id: ${id} ${public_key}"
|
|||
# change to ipv6
|
||||
viwib_ip=${my_lan_ip}
|
||||
|
||||
sleep 15
|
||||
|
||||
while ! ping6 -c5 ${viwib_ip}; do
|
||||
echo "Waiting for viwib ${id}"
|
||||
sleep 2
|
||||
|
|
Loading…
Reference in a new issue