Home Forums Software discussion Linux Kernel Should "iptables -L" work with your kernel config?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #570
    CaptainData
    Participant

    I used the ubuntu_config and built a new kernel.

    When I try to view the table, I get:
    root@localhost:~# iptables -L
    iptables v1.6.0: can’t initialize iptables table `filter’: Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.
    root@localhost:~#

    Shouldn’t this work? Do I need to load modules?

    #571
    CaptainData
    Participant

    Here’s what’s configured:
    root@localhost:~# zgrep NETFILTER /proc/config.gz
    CONFIG_NETFILTER=y
    # CONFIG_NETFILTER_DEBUG is not set
    CONFIG_NETFILTER_ADVANCED=y
    CONFIG_BRIDGE_NETFILTER=m
    CONFIG_NETFILTER_INGRESS=y
    # CONFIG_NETFILTER_NETLINK_ACCT is not set
    # CONFIG_NETFILTER_NETLINK_QUEUE is not set
    # CONFIG_NETFILTER_NETLINK_LOG is not set
    CONFIG_NETFILTER_XTABLES=y
    # CONFIG_NETFILTER_XT_MARK is not set
    # CONFIG_NETFILTER_XT_CONNMARK is not set
    # CONFIG_NETFILTER_XT_TARGET_AUDIT is not set
    # CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
    # CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
    # CONFIG_NETFILTER_XT_TARGET_HMARK is not set
    # CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set
    # CONFIG_NETFILTER_XT_TARGET_LED is not set
    # CONFIG_NETFILTER_XT_TARGET_LOG is not set
    # CONFIG_NETFILTER_XT_TARGET_MARK is not set
    CONFIG_NETFILTER_XT_NAT=y
    # CONFIG_NETFILTER_XT_TARGET_NETMAP is not set
    # CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
    # CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
    # CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
    # CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set
    # CONFIG_NETFILTER_XT_TARGET_TEE is not set
    # CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
    # CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set
    # CONFIG_NETFILTER_XT_MATCH_BPF is not set
    # CONFIG_NETFILTER_XT_MATCH_CGROUP is not set
    # CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
    # CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
    # CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
    # CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set
    # CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
    # CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
    # CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
    # CONFIG_NETFILTER_XT_MATCH_CPU is not set
    # CONFIG_NETFILTER_XT_MATCH_DCCP is not set
    # CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set
    # CONFIG_NETFILTER_XT_MATCH_DSCP is not set
    # CONFIG_NETFILTER_XT_MATCH_ECN is not set
    # CONFIG_NETFILTER_XT_MATCH_ESP is not set
    # CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
    # CONFIG_NETFILTER_XT_MATCH_HELPER is not set
    # CONFIG_NETFILTER_XT_MATCH_HL is not set
    # CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set
    # CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
    # CONFIG_NETFILTER_XT_MATCH_L2TP is not set
    # CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
    # CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
    # CONFIG_NETFILTER_XT_MATCH_MAC is not set
    # CONFIG_NETFILTER_XT_MATCH_MARK is not set
    # CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
    # CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
    # CONFIG_NETFILTER_XT_MATCH_OWNER is not set
    # CONFIG_NETFILTER_XT_MATCH_POLICY is not set
    # CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
    # CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
    # CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
    # CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
    # CONFIG_NETFILTER_XT_MATCH_REALM is not set
    # CONFIG_NETFILTER_XT_MATCH_RECENT is not set
    # CONFIG_NETFILTER_XT_MATCH_SCTP is not set
    # CONFIG_NETFILTER_XT_MATCH_SOCKET is not set
    # CONFIG_NETFILTER_XT_MATCH_STATE is not set
    # CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
    # CONFIG_NETFILTER_XT_MATCH_STRING is not set
    # CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
    # CONFIG_NETFILTER_XT_MATCH_TIME is not set
    # CONFIG_NETFILTER_XT_MATCH_U32 is not set
    root@localhost:~#

    #572
    brianb
    Participant

    I used the instructions on the wiki to build the kernel, but despite using the recommended configuration, the iptables modules do not seem to have been included: http://espressobin.net/forums/topic/iptables-and-state-match-support/

    #608
    akrog
    Keymaster

    Hello CaptainData,

    The ubuntu_config was made solely with the idea of enabling basic routing and does not include the wide number of iptables modules, neither are they enabled by default. To enable them, include the desired modules in your kernel config, i.e. to add the basic filter table enable:

    CONFIG_IP_NF_FILTER=y

    in your .config or enable IP_NF_FILTER via make menuconfig:

    Symbol: IP_NF_FILTER [=y]
    Type  : tristate
    Prompt: Packet filtering
      Location:
        -> Networking support (NET [=y])
          -> Networking options
            -> Network packet filtering framework (Netfilter) (NETFILTER [=y])
              -> IP: Netfilter Configuration
    (1)         -> IP tables support (required for filtering/masq/NAT) (IP_NF_IPTABLES [=y])
      Defined at net/ipv4/netfilter/Kconfig:231
      Depends on: NET [=y] && INET [=y] && NETFILTER [=y] && IP_NF_IPTABLES [=y]

    rebuild the kernel and boot Ubuntu with the newly build images.

    #743
    brianb
    Participant

    I put together a simple website with details about how I built the kernel with iptables/netfilter support. I have also included directions for getting the lan interfaces setup with static IP addresses.

    The kernel Image is not yet available for download, but I hope to have it up soon.

    http://espressobin.exertussoftware.com/index.html

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Signup to our newsletter

Technical specification tables can not be displayed on mobile. Please view on desktop