Merge pull request #8319 from brianjmurrell/shorewall-iface-update

Shorewall: start and enable interfaces all in hotplug
This commit is contained in:
Hannu Nyman 2019-03-27 17:28:56 +02:00 committed by GitHub
commit de5efc91b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 22 deletions

View file

@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
PKG_BUGFIX_MINOR_VERSION:=.2 PKG_BUGFIX_MINOR_VERSION:=.2
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION) PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION) PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \

View file

@ -1,13 +1,19 @@
#!/bin/sh #!/bin/sh
# should restart shorewall when an interface comes up DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
case "$ACTION" in case "$ACTION" in
ifup) ifup)
/etc/init.d/shorewall-lite restart if [ "$INTERFACE" = "lan" ]; then
/usr/sbin/shorewall -l start
elif [ "${INTERFACE:0:3}" = "wan" ] &&
[ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
/etc/shorewall-lite/state/firewall enable "$DEVICE"
fi
;; ;;
ifdown) ifdown)
# might need to restore some routing if [ "${INTERFACE:0:3}" = "wan" ]; then
/etc/init.d/shorewall-lite restart /etc/shorewall-lite/state/firewall disable "$DEVICE"
fi
;; ;;
esac esac

View file

@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
PKG_BUGFIX_MINOR_VERSION:=.2 PKG_BUGFIX_MINOR_VERSION:=.2
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION) PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION) PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \

View file

@ -1,13 +1,19 @@
#!/bin/sh #!/bin/sh
# should restart shorewall when an interface comes up DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
case "$ACTION" in case "$ACTION" in
ifup) ifup)
/etc/init.d/shorewall restart if [ "$INTERFACE" = "lan" ]; then
/usr/sbin/shorewall start
elif [ "${INTERFACE:0:3}" = "wan" ] &&
[ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
/etc/shorewall/state/firewall enable "$DEVICE"
fi
;; ;;
ifdown) ifdown)
# might need to restore some routing if [ "${INTERFACE:0:3}" = "wan" ]; then
/etc/init.d/shorewall restart /etc/shorewall/state/firewall disable "$DEVICE"
fi
;; ;;
esac esac

View file

@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
PKG_BUGFIX_MINOR_VERSION:=.2 PKG_BUGFIX_MINOR_VERSION:=.2
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION) PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION) PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \

View file

@ -1,13 +1,19 @@
#!/bin/sh #!/bin/sh
# should restart shorewall when an interface comes up DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
case "$ACTION" in case "$ACTION" in
ifup) ifup)
/etc/init.d/shorewall6-lite restart if [ "$INTERFACE" = "lan" ]; then
/usr/sbin/shorewall -6 -l start
elif [ "${INTERFACE:0:3}" = "wan" ] &&
[ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
/etc/shorewall6-lite/state/firewall enable "$DEVICE"
fi
;; ;;
ifdown) ifdown)
# might need to restore some routing if [ "${INTERFACE:0:3}" = "wan" ]; then
/etc/init.d/shorewall6-lite restart /etc/shorewall6-lite/state/firewall disable "$DEVICE"
fi
;; ;;
esac esac

View file

@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
PKG_BUGFIX_MINOR_VERSION:=.2 PKG_BUGFIX_MINOR_VERSION:=.2
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION) PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION) PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \ http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \

View file

@ -1,13 +1,19 @@
#!/bin/sh #!/bin/sh
# should restart shorewall when an interface comes up DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
case "$ACTION" in case "$ACTION" in
ifup) ifup)
/etc/init.d/shorewall6 restart if [ "$INTERFACE" = "lan" ]; then
/usr/sbin/shorewall -6 start
elif [ "${INTERFACE:0:3}" = "wan" ] &&
[ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
/etc/shorewall6/state/firewall enable "$DEVICE"
fi
;; ;;
ifdown) ifdown)
# might need to restore some routing if [ "${INTERFACE:0:3}" = "wan" ]; then
/etc/init.d/shorewall6 restart /etc/shorewall6/state/firewall disable "$DEVICE"
fi
;; ;;
esac esac