Jump to content

Iptables on Xenial server Vanilla


Antiel

Recommended Posts

Hello there,

hope you been able to give me a hand; I've downloaded and installed without problems the current Xenial server Vanilla distro on my Banana pi. Then I've tried installing iptables, but for some reason, everytime I execute 'sudo systemctl start iptables' I receive the following error message:

Failed to start iptables.service: Unit iptables.service not found.

I know that something has got installed, as iptables -L provides the expected output; however, any systemctl command for iptables (start, stop, enable, restart) fails with the message above. Certinaly, searching for 'iptables.service' at file system returns no matchs, so file is really missing.

My understanding is that such file should be created during iptables deployment, am I right?. Any idea?. Most of the posts I've found at google on this topics are related to Fedora / Centos; also a few ones are related to PATH variable, but it doesn't seem to be my case.

Please find below the whole installation / execution process:

* sudo iptables -L
  sudo: iptables: command not found

* sudo apt-get update

* sudo apt-get install iptables

* sudo iptables -L

  Chain INPUT (policy ACCEPT)
  target     prot opt source               destination

  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination

  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination

* sudo journalctl -r

 

  oct 26 18:43:40 sudo[3433]: pam_unix(sudo:session): session closed for user root
  oct 26 18:43:40 sudo[3433]: pam_unix(sudo:session): session opened for user root by root(uid=0)
  oct 26 18:43:40 sudo[3433]:     root : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/sbin/iptables -L
  oct 26 18:43:27 sudo[2989]: pam_unix(sudo:session): session closed for user root
  oct 26 18:42:55 sudo[2989]: pam_unix(sudo:session): session opened for user root by root(uid=0)
  oct 26 18:42:55 sudo[2989]:     root : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/usr/bin/apt-get install iptables
  oct 26 18:42:17 sudo[2796]: pam_unix(sudo:session): session closed for user root
  oct 26 18:41:52 sudo[2796]: pam_unix(sudo:session): session opened for user root by root(uid=0)
  oct 26 18:41:52 sudo[2796]:     root : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/usr/bin/apt-get update

* sudo systemctl start iptables
  Failed to start iptables.service: Unit iptables.service not found.

* sudo find / -iname "iptables.*"
  /var/lib/dpkg/info/iptables.list
  /var/lib/dpkg/info/iptables.shlibs
  /var/lib/dpkg/info/iptables.md5sums
  /var/lib/dpkg/info/iptables.triggers
  /usr/share/iptables/iptables.xslt
  /usr/share/man/man8/iptables.8.gz
  /usr/src/linux-headers-4.7.3-sunxi/include/config/ip6/nf/iptables.h
  /usr/src/linux-headers-4.7.3-sunxi/include/config/ip/nf/iptables.h

* sudo systemctl status iptables
â— iptables.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

 

* sudo journalctl -r
oct 26 19:09:51 sudo[3580]:     root : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/bin/systemctl start iptables
oct 26 19:09:51 sudo[3580]: pam_unix(sudo:session): session opened for user root by root(uid=0)
oct 26 19:09:51 sudo[3580]: pam_unix(sudo:session): session closed for user root
oct 26 19:11:45 sudo[3595]:     root : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/bin/systemctl status iptables
oct 26 19:11:45 sudo[3595]: pam_unix(sudo:session): session opened for user root by root(uid=0)
oct 26 19:11:45 sudo[3595]: pam_unix(sudo:session): session closed for user root

Thanks a lot in advance,
Antiel.

 

P.S I've tried removing the package and resintalling again, but no way...

 

Link to comment
Share on other sites

Hello Zador,

 

many thanks for your comments. I did gave a try to iptables-persistent package and generate the IP4 / IP6 files, but was still trying to run 'systemctl start iptables'. Your following comment did the trick:

 

 

There is no iptables service in iptables package

 

Now I understand that the proper way is to replace"systemctl start iptables" with ''systemctl start netfilter-persistent" and let them take care of iptables rules.

 

Thanks again,

Antiel.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines