Iptables not create rules

Protecting your Linux box

Iptables not create rules

Postby majidnazeer » Sat Oct 21, 2006 3:54 pm

Hi all!

I try to create rule by iptables. Command successfully run, but that rule not show in list.

# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

when i check iptables list by iptables -L command. doen't have any entry. Anybody know how to solve this problem.

Thanks
Majid
majidnazeer
Naik
 
Posts: 60
Joined: Wed Oct 05, 2005 12:37 pm

Postby lambda » Sat Oct 21, 2006 4:40 pm

read the documentation for iptables carefully. you need to do "iptables -t nat -L" to see the rules in the nat table.
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby asim.mcp » Sun Oct 22, 2006 7:21 pm

to check the command you've applied in iptables you'll apply this command

Code: Select all

# iptables -t nat -L OR iptables -t nat -nvL
asim.mcp
Cadet
 
Posts: 4
Joined: Tue Aug 29, 2006 2:45 am

Re:

Postby LinuxFreaK » Mon Oct 23, 2006 7:46 am

Dear majidnazeer,
Salam,

When you are tying to see tables rules. You need to specify it by using -t tables-name. However by default iptables do have only three tables.

Code: Select all

1. nat
2. mangle
3. filter


You should always look into iptables documentation.

FYI, http://www.netfilter.org/documentation/

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Iptables not create rules

Postby majidnazeer » Fri Oct 27, 2006 10:00 am

Dear Farrukh!

EID MUBARAK

I use switch L for checking iptables rule. I use this command.

# iptables -L then enter

There don't have any rule mention, whenever i successfully run below command at prompt.

# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

When i open firewall. iptables show rules on list. Why???????


Thanks
majidnazeer
Naik
 
Posts: 60
Joined: Wed Oct 05, 2005 12:37 pm

Re:

Postby LinuxFreaK » Sun Oct 29, 2006 10:19 am

Dear majidnazeer,
Salam,

As i have told you in my last reply that you need to specify -t.

# iptables -t nat -L -n --line

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby A Ahmed » Sat Nov 25, 2006 12:31 am

Salam,
Dear Sir i am new in linux. i want to learn about linux for saving money who i give that person who solve my problem plz tell me any way where i study and knowledged about linux.
Regard
Adnan Ahmed
A Ahmed
Cadet
 
Posts: 3
Joined: Thu Nov 23, 2006 3:07 pm
WLM: dainy_libra@hotmail.com
Yahoo Messenger: ssadnans@yahoo.com
Location: Lahore. Pakistan

Postby kbukhari » Sat Nov 25, 2006 1:16 am

Linux is not much difficult you can start learning it from your own home just install it and also u have internet and google.com is your best friend
and http://linuxpakistan.net ans http://sysadminsline.com are your very best friends
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
kbukhari
Major General
 
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Website: http://kashifbukhari.com
Location: Lahore

Re:

Postby LinuxFreaK » Mon Nov 27, 2006 9:14 am

Dear A Ahmed,
Salam,

A Ahmed wrote:Dear Sir i am new in linux. i want to learn about linux for saving money who i give that person who solve my problem plz tell me any way where i study and knowledged about linux.


I would like to prefer you to go through following links.

http://www.linuxhomenetworking.com
http://www.tldp.org

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi


Return to “%s” Security

Who is online

Users browsing this forum: No registered users and 1 guest

cron