iptables NAT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iptables NAT

Jump to solution
6,780 Views
niklasmolin
Senior Contributor I

Hi.

I wonder if some one knows if it's possible to add NAT in the iptables (Yocto project)?

I checked in the .config file, but there seems to be no flag for that.

Is this something that is planned to be included?

Thanks,

Niklas

Labels (2)
1 Solution
3,131 Views
niklasmolin
Senior Contributor I

I managed to figure it out.

First I had to enable Netfilter connection tracking support in the Core Netfilter Configuration menu.

After that I go to IP: Netfilter Configuration menu, and enable IPv4 connection tracking support.

View solution in original post

6 Replies
3,131 Views
MarekVasut
Senior Contributor I

You mean CONFIG_IP_NF_IPTABLES is missing in the kernel config ?

0 Kudos
3,131 Views
niklasmolin
Senior Contributor I

I can find the CONFIG_IP_NF_IPTABLES, but I'm looking for NF_NAT, NF_NAT_IPV4 etc. I can't find them in the .config file.

I'm using kernel 3.10.9.

0 Kudos
3,131 Views
MarekVasut
Senior Contributor I

Well run

$ make ARCH=arm CROSS_COMPILE=... menuconfig

Then navigate into Networking support -> Networking options -> Network packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> IP tables support (required for filtering/masq/NAT)

... or you can just hit the 'slash' [/] key and type "IP_NF_IPTABLES" , which will give you the exact location of the config option.

0 Kudos
3,132 Views
niklasmolin
Senior Contributor I

I managed to figure it out.

First I had to enable Netfilter connection tracking support in the Core Netfilter Configuration menu.

After that I go to IP: Netfilter Configuration menu, and enable IPv4 connection tracking support.

3,131 Views
gavingreenwalt
Contributor III

I'm glad to hear that it's possible, but could you share a noob-friendly list of everything that needs to be enabled to get iptables NAT working.

I tried just bitbaking the iptables package and created an iptables.ipk however on installation it warned that I was missing the kernel modules so I figure I might as well rebuild the whole thing since I'll need an image eventually anyway.

0 Kudos
3,131 Views
niklasmolin
Senior Contributor I

I can start the menuconfig and get down to IP tables support (required for filtering/masq/NAT)

But I can't find anywhere to enable NAT, to set the NF_NAT flag (and I can't find the NF_NAT in the .config file either).

0 Kudos