I'm learning to configure firewall rules using iptables. For some reason, iptables does not recognize LOG as a valid target:

○ sudo iptables -A INPUT -p icmp -j LOG iptables: No chain/target/match by that name.

Extra info:

○ sudo iptables iptables v1.6.0: no command specified Try `iptables -h' or 'iptables --help' for more information. ○ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial

I'm not really sure where to go from here. I thought LOG would be a built-in target with iptables. Any help would be appreciated.

EDIT: I forgot to mention that this is Ubuntu 16.04 running on my chromebook via Crouton.

  • I don't have an Ubuntu 16.04.3 installation readily available, but does your kernel have the NETFILTER_XT_TARGET_LOG module available (check /proc/config.gz)? – ErikF Jan 8 '18 at 7:52
  • @ErikF that file does not exist in my ChromeOS chroot. – Richard Huynh Jan 9 '18 at 2:12

I suppose you don't have xt_LOG module installed.
filename: /lib/modules/x.xx.x-xx-generic/kernel/net/netfilter/xt_LOG.ko
alias: ip6t_LOG
alias: ipt_LOG

Check it:

lsmod | grep xt_LOG

Install/add it:

sudo modprobe xt_LOG

Also check your kernel config at: /boot/config-x.xx.x-xx-generic

  • I tried doing sudo modprobe xt_LOG, but it didn't work. I also checked my /boot/ directory and there are 0 files in there. I guessing this may be due to the fact that I am running this on my chromebook via crouton (which I definitely forgot to mention, my fault. I'll update my question with that information.) – Richard Huynh Jan 8 '18 at 21:04
  • 2
    Not surprising to not have anything in /boot being that Crouton is a chroot environment inside of ChomeOS; you're still running on the ChromeOS kernel. – virullius Jan 8 '18 at 22:47
  • This might help github.com/dnschneid/crouton/wiki/… but I have no experience with Crouton on ChromeOS – Petr Jan 9 '18 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.