Answer the question
In order to leave comments, you need to log in
Firewall fails on ubuntu-server-16?
I created a script in init.d
#! /bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $syslog $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Fill iptables rules
### END INIT INFO
ip=/sbin/iptables
LOCAL_IF=eth1
LOCAL_NET="192.168.1.0/24"
INET_IF=eth0
INET_IP=10.10.1.6/24
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
$ip -A INPUT -p tcp --dport 4491 -j ACCEPT
$ip -P INPUT DROP
}
do_stop (){
$ip -F
$ip -t nat -F
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
[....] Starting firewall (via systemctl): firewall.serviceJob for firewall.service failed because the control process exited with error code. See "systemctl status firewall.service" and "journalctl -xe" for details.
failed!
● firewall.service - LSB: Fill iptables rules
Loaded: loaded (/etc/init.d/firewall; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2017-03-10 22:50:23 EET; 58s ago
Docs: man:systemd-sysv-generator(8)
Process: 2424 ExecStart=/etc/init.d/firewall start (code=exited, status=203/EXEC)
Mar 10 22:50:23 gateway-office systemd[1]: Starting LSB: Fill iptables rules...
Mar 10 22:50:23 gateway-office systemd[1]: firewall.service: Control process exited, code=exited status=203
Mar 10 22:50:23 gateway-office systemd[1]: Failed to start LSB: Fill iptables rules.
Mar 10 22:50:23 gateway-office systemd[1]: firewall.service: Unit entered failed state.
Mar 10 22:50:23 gateway-office systemd[1]: firewall.service: Failed with result 'exit-code'.
firewall.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable firewall
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question