From 8ebae57e5f06da70f579614f7c2d58fedc56f44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0urda?= Date: Tue, 14 Feb 2023 12:26:33 +0800 Subject: [PATCH] Change network defaults - eth0 is WAN, eth1 LAN - firewall allow incoming SSH --- defaults/49-network | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 defaults/49-network diff --git a/defaults/49-network b/defaults/49-network new file mode 100644 index 0000000..3180212 --- /dev/null +++ b/defaults/49-network @@ -0,0 +1,21 @@ +# switch LAN to eth1 +/sbin/uci set network.@device[0].ports='eth1' + +# set WAN to eth0 +/sbin/uci set network.wan=interface +/sbin/uci set network.wan.device=eth0 +/sbin/uci set network.wan.proto=dhcp + +# firewall allow SSH +/sbin/uci add firewall rule +/sbin/uci set firewall.@rule[-1].name='Allow-SSH' +/sbin/uci set firewall.@rule[-1].src='wan' +/sbin/uci set firewall.@rule[-1].dest_port='22' +/sbin/uci set firewall.@rule[-1].proto='tcp' +/sbin/uci set firewall.@rule[-1].target='ACCEPT' + +/sbin/uci commit + +/sbin/service network restart +/sbin/service firewall restart +/sbin/service dnsmasq restart