conntrack -L does not show any connection

10,923

Solution 1

If /proc/net/ip_conntrack is empty, you may have conntrack modules not loaded. Try

modprobe nf_conntrack

Solution 2

You can use iptables module 'conntrack' to do something, then conntrack -L will have output.

iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

Solution 3

You'll have to modprobe nf_conntrack and it's ipv4/ipv6 modules.

  • modprobe nf_conntrack
  • modprobe nf_conntrack_ipv4
  • modprobe nf_conntrack_ipv6
Share:
10,923

Related videos on Youtube

SeattleOrBayArea
Author by

SeattleOrBayArea

Updated on September 18, 2022

Comments

  • SeattleOrBayArea
    SeattleOrBayArea almost 2 years

    I am writing a utility which will use Conntrack commands to show the connection states. I am a beginner and I wanted to play with the Conntrack before I could start my work. So, when I tried conntrack -L conntrack, I get the output which says there are no flows. But, I do have a telnet and one ssh connection to the machine, which is seen in netstat as in ESTABLISHED state.

    I also did tail -f /proc/net/ip_conntrack but didn't see any output.

    Am I missing something?

  • SeattleOrBayArea
    SeattleOrBayArea over 12 years
    I did lsmod | grep nf_conntrack. It shows that conntrack is loaded already. Do I need to configure firewall or something for this to work? As per my understanding, it is not needed for basic testing.
  • SeattleOrBayArea
    SeattleOrBayArea over 12 years
    I dont know how but it started to work, thanks!!
  • Osqui
    Osqui over 4 years
    It seems there's no nf_conntrack_ipv4 nor nf_conntrack_ipv6 modules in Fedora 31 stock kernel (I have installed conntrack-tools and libnetfilter-conntrack packages). I have exactly the same problem but I just have nf_conntrack and nf_conntrack_netlink loaded. I don't know what can be...My Nftables version (0.9.1) or Kernel (5.5.9) isn't compatible?