feat: x86 configuration
This commit is contained in:
parent
0ce214195e
commit
230251703e
@ -1,3 +0,0 @@
|
||||
install-x86-network-config:
|
||||
mkdir -p files/etc/config
|
||||
cp misc/x86/uci/network files/etc/config/network
|
7
install/x86.mk
Normal file
7
install/x86.mk
Normal file
@ -0,0 +1,7 @@
|
||||
install-x86-network-config:
|
||||
mkdir -p files/etc/config
|
||||
cp misc/x86/uci/network files/etc/config/network
|
||||
|
||||
install-x86-firewall-rules:
|
||||
mkdir -p files/etc/uci-defaults
|
||||
cp misc/x86/uci-defaults/99-x86-firewall-rules.sh files/etc/uci-defaults/99-x86-firewall-rules.sh
|
39
misc/x86/uci-defaults/99-x86-firewall-rules.sh
Normal file
39
misc/x86/uci-defaults/99-x86-firewall-rules.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
main() {
|
||||
uci add firewall rule
|
||||
uci set firewall.@rule[-1].name='Allow SSH on WAN'
|
||||
uci set firewall.@rule[-1].src='wan'
|
||||
uci set firewall.@rule[-1].proto='tcp'
|
||||
uci set firewall.@rule[-1].dest_port='22'
|
||||
uci set firewall.@rule[-1].target='ACCEPT'
|
||||
|
||||
uci add firewall rule
|
||||
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
|
||||
uci set firewall.@rule[-1].src='wan'
|
||||
uci set firewall.@rule[-1].proto='tcp'
|
||||
uci set firewall.@rule[-1].dest_port='80'
|
||||
uci set firewall.@rule[-1].target='ACCEPT'
|
||||
|
||||
uci add firewall rule
|
||||
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
|
||||
uci set firewall.@rule[-1].src='wan'
|
||||
uci set firewall.@rule[-1].proto='tcp'
|
||||
uci set firewall.@rule[-1].dest_port='443'
|
||||
uci set firewall.@rule[-1].target='ACCEPT'
|
||||
|
||||
uci commit firewall
|
||||
service firewall restart
|
||||
|
||||
# Forward DNS queries to public DNS
|
||||
uci -q delete dhcp.@dnsmasq[0].server
|
||||
uci add_list dhcp.@dnsmasq[0].server="8.8.8.8"
|
||||
uci add_list dhcp.@dnsmasq[0].server="8.8.4.4"
|
||||
|
||||
uci commit dhcp
|
||||
service dnsmasq restart
|
||||
}
|
||||
|
||||
main
|
@ -2,7 +2,7 @@ all: x86_generic
|
||||
|
||||
x86_generic:
|
||||
$(MAKE) \
|
||||
ADDITIONAL_INSTALL="install-x86-network-config" \
|
||||
ADDITIONAL_INSTALL="install-x86-network-config install-x86-firewall-rules" \
|
||||
OPENWRT_TARGET="x86/generic" \
|
||||
EMISSARY_ARCH="386" \
|
||||
OPENWRT_PROFILE="generic" \
|
||||
|
Loading…
Reference in New Issue
Block a user