iptables NAT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

iptables NAT

跳至解决方案
7,723 次查看
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

标签 (2)
1 解答
4,074 次查看
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.

在原帖中查看解决方案

6 回复数
4,074 次查看
MarekVasut
Senior Contributor I

You mean CONFIG_IP_NF_IPTABLES is missing in the kernel config ?

0 项奖励
回复
4,074 次查看
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 项奖励
回复
4,074 次查看
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 项奖励
回复
4,075 次查看
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.

4,074 次查看
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 项奖励
回复
4,074 次查看
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 项奖励
回复