Change network defaults
All checks were successful
buildbot/multibuild_parent Build done.
buildbot/travis_bionic Build done.
buildbot/job/openwrt Build done.

- eth0 is WAN, eth1 LAN
- firewall allow incoming SSH
This commit is contained in:
Peter Šurda 2023-02-14 12:26:33 +08:00
parent cd8043f92b
commit 8ebae57e5f
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95

21
defaults/49-network Normal file
View File

@ -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