2023-03-01 08:15:29 +01:00
|
|
|
VERSION=1
|
2023-02-16 01:48:26 +01:00
|
|
|
|
2023-05-23 06:47:00 +02:00
|
|
|
[ "$(uci -q get defaults.version.network)" -ge "$VERSION" ] && exit
|
2023-03-01 08:15:29 +01:00
|
|
|
|
|
|
|
# save version
|
|
|
|
/sbin/uci set defaults.version.network="$VERSION"
|
2023-02-15 02:36:03 +01:00
|
|
|
|
2023-02-14 05:26:33 +01:00
|
|
|
# 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
|