LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2012, 05:22 AM   #1
lax.rawat07
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Rep: Reputation: Disabled
iptables nat


Hi i am new in linux and working on a project where i am working on iptables.
i have installed iptables in system.when i am giving this cmmand "iptables --table nat --flush"
its giving ""iptables v1.4.15: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)Perhaps iptables or your kernel needs to be upgraded." this error

so please help me

regards
lax

Last edited by lax.rawat07; 08-27-2012 at 05:23 AM.
 
Old 08-27-2012, 05:51 AM   #2
lievendp
Member
 
Registered: Jan 2006
Location: Belgique
Distribution: Gentoo, Debian, Redhat, Centos, (x)Ubuntu
Posts: 111

Rep: Reputation: 27
not sure but do you have enabled ip forwarding?
cat /proc/sys/net/ipv4/ip_forward
should be 1.

Did you check if the modules are loaded?
lsmod
? ip_conntrack ?
? iptable_nat ?
probably also some others?

If you're using iptables, I can also suggest you look at fwbuilder to get a good gui-based policy/nat iptables builder program.

Last edited by lievendp; 08-27-2012 at 05:55 AM. Reason: extra info
 
Old 08-27-2012, 06:04 AM   #3
lax.rawat07
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
i did the lsmod and i found these modules

Module Size Used by
iptable_filter 1091 1
ip_tables 10941 1 iptable_filter
x_tables 12531 2 iptable_filter,ip_tables
bridge 66069 0
stp 1334 1 bridge
llc 3080 2 bridge,stp
wl12xx_sdio 3395 0
wl12xx 118681 1 wl12xx_sdio
evbug 1525 0


Not able to find
? ip_conntrack ?
? iptable_nat ?
these entry
cat /proc/sys/net/ipv4/ip_forward values is 1
so please tell me how i can get this

Last edited by lax.rawat07; 08-27-2012 at 06:09 AM.
 
Old 08-27-2012, 07:33 AM   #4
lievendp
Member
 
Registered: Jan 2006
Location: Belgique
Distribution: Gentoo, Debian, Redhat, Centos, (x)Ubuntu
Posts: 111

Rep: Reputation: 27
Can you try

modprobe iptable_nat

as root?
what is the result of "modinfo iptable_nat"
I see that ip_conntrack is now nf_conntrack on my xubuntu system but in the info from iptable_nat it should be mentionned as dependency.

After the modprobe, check if the iptable_nat is loaded with lsmod | grep iptable_nat

What distro are you working on? which version of kernel (uname -a) Did you do an upgrade or is this a fresh install? (from cd?)
 
Old 08-27-2012, 07:53 AM   #5
lax.rawat07
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
modprobe iptable_nat command eneded with
"FATAL: Module iptable_nat not found."

and i am using 3.0.3.ti-omap3-beagle-2.6.29 linux kernel for monta vista
 
Old 08-27-2012, 08:06 AM   #6
lievendp
Member
 
Registered: Jan 2006
Location: Belgique
Distribution: Gentoo, Debian, Redhat, Centos, (x)Ubuntu
Posts: 111

Rep: Reputation: 27
never heard of monta vista but there are so many ... it seems something light-weight embedded thing per distrowatch site.

no iptable_nat module, hmm how to get it? Is there a package manager on your system like apt-get or yum?
 
Old 08-27-2012, 08:12 AM   #7
lievendp
Member
 
Registered: Jan 2006
Location: Belgique
Distribution: Gentoo, Debian, Redhat, Centos, (x)Ubuntu
Posts: 111

Rep: Reputation: 27
What you are probably missing is the support for iptables netfilter in your kernel.

Try to search your package-manager if any for a kernel that supports netfilter/iptables. Or you will have to compile your own kernel and do also the modules_install.
 
Old 08-27-2012, 08:14 AM   #8
lax.rawat07
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Unhappy

there is no option for apt-get and yum,

can i have to make changes in my kernel .config file or load the module
i have try both the option!!
anyone from networking domain will have the better idea .......
 
Old 08-27-2012, 08:41 AM   #9
lievendp
Member
 
Registered: Jan 2006
Location: Belgique
Distribution: Gentoo, Debian, Redhat, Centos, (x)Ubuntu
Posts: 111

Rep: Reputation: 27
if modprob iptable_nat fails, it means there is no support in your kernel and the module is not installed on your system.
A quick google (http://meld.org/discussion/general-d...-montavista-40) learned me that for monta vista, you have to copy the nec. files from somewhere.

for compile of the kernel, you need the sources
then enter the directory with the kernel sources
make menuconfig (if it exists on monta vista)
go through the netfilter options and enable the options for iptables, I think somewhere in device drivers / networking support.

and then compile the kernel and modules with
make && make modules_install
make install => move files to places in boot etc.

regds.

Last edited by lievendp; 08-27-2012 at 08:43 AM. Reason: completion info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTables 1:1 NAT Garak Linux - Security 13 12-19-2011 06:03 PM
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 11:15 AM
iptables nat kernelvn Linux - Networking 5 05-03-2005 12:39 PM
IPTABLES : build NAT using IPTABLES joseph Linux - Networking 4 04-23-2004 06:08 AM
IPtables +NAT daromer Linux - Networking 1 01-07-2002 12:15 PM


All times are GMT -5. The time now is 05:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration