X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=wrt-setup-local;h=1f0a2d547cf90223d71b5646a688ed6e329809e3;hb=2fad38490e36bd2f0328b82c38448d9675e662e8;hp=6201f866f924cce43312e5d25b047b62e2897c19;hpb=b5682902b6dce0a3d799e129877c8b43c4509774;p=automated-distro-installer diff --git a/wrt-setup-local b/wrt-setup-local index 6201f86..1f0a2d5 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -40,11 +40,6 @@ EOF -dnsmasq_restart=false -firewall_restart=false -dev2=false -test=false -libremanage_host=wrt2 secrets=false if [[ -e /root/router-secrets ]]; then @@ -58,6 +53,12 @@ fi : ${hostname:=wrt} +dnsmasq_restart=false +firewall_restart=false +dev2=false +test=false +client=false +libremanage_host=wrt2 lanip=1 while getopts hm:t: opt; do case $opt in @@ -317,6 +318,9 @@ if $client; then uset wireless.radio0.disabled false uset wireless.radio1.disabled true else + # defaults, just reseting in case client config ran + uset wireless.default_radio0.network lan + uset wireless.default_radio0.mode ap for x in 0 1; do uset wireless.default_radio$x.ssid "$ssid" uset wireless.default_radio$x.key $key @@ -573,6 +577,18 @@ config rule option target ACCEPT option dest_port 2208 +config redirect + option name sshbb8 + option src wan + option src_dport 2209 + option dest_port 22 + option dest_ip $l.9 + option dest lan +config rule + option src wan + option target ACCEPT + option dest_port 2209 + config redirect option name icecast option src wan @@ -600,21 +616,7 @@ config rule config redirect - option name vpntp - option src wan - option src_dport 1196 - option dest lan - option dest_ip $l.8 - option proto udp -config rule - option src wan - option target ACCEPT - option dest_port 1196 - option proto udp - - -config redirect - option name httptp + option name httpkd option src wan option src_dport 80 option dest lan @@ -627,7 +629,7 @@ config rule option proto tcp config redirect - option name httpstp + option name httpskd option src wan option src_dport 443 option dest lan @@ -698,46 +700,35 @@ EOF } firewall-cedit || firewall_restart=true -if ! uci get firewall.@zone[1].network | grep wg0 &>/dev/null; then - # cant mix cedit plus uci - echo | cedit /etc/config/firewall ||: - uci add_list firewall.@zone[1].network=wg0 - uci commit firewall - firewall-cedit ||: - firewall_restart=true -fi +# not using wireguard for now +# if ! uci get firewall.@zone[1].network | grep wg0 &>/dev/null; then +# # cant mix cedit plus uci +# echo | cedit /etc/config/firewall ||: +# uci add_list firewall.@zone[1].network=wg0 +# uci commit firewall +# firewall-cedit ||: +# firewall_restart=true +# fi v cedit /etc/hosts < [1614982580.5192] dhcp6 (wlan0): option dhcp6_name_servers => 'fd58:5801:8e02::1' +# but i dont want ipv6 dns, just keep it simple to ipv4. +uset dhcp.@odhcpd[0].dns 10.2.0.1 + # disabled for now. i want to selectively enable it # for specific hosts. @@ -778,19 +776,14 @@ EOF # to start. mkdir -p /mnt/usb/tftpboot v cedit /etc/dnsmasq.conf < 2.80. currently at 2.80. + # todo: download https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/dnsmasq-full_2.84-1_mipsel_24kc.ipk + # and install it. then we can turn off dnssec in systemd-resolved + # + # Also, reload of dnsmasq seems to break things, wifi + # clients were not getting internet connectivity. v /etc/init.d/dnsmasq restart fi