LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-20-2004, 01:03 PM   #1
campusloop
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora
Posts: 6

Rep: Reputation: 0
help ip masquerading


Hi,
I have some doubt if the firewall rules are correctly being setup so could someone please verify for me if the iptables -L output for the following firewall script is correct. the masquerading is not being setup properly

Code:
!/bin/bash
IPTABLES=/usr/sbin/iptables

echo 1 > /proc/sys/net/ipv4/ip_forward

$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F

$IPTABLES -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i eth1 -o eth0 -j ACCEPT

$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
output of iptables -L is
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
thanx.

Last edited by campusloop; 05-20-2004 at 01:09 PM.
 
Old 05-20-2004, 01:37 PM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
The command used by you lists the settings partially only (see 'man iptables' option -L).
For full info use (for instance) the following script:
Code:
#!/bin/sh
echo "iptables.mangling:"
iptables -t mangle -v -L -n
echo
echo "iptables.nat:"
iptables -t nat -v -L -n
echo
echo "iptables.filter:"
iptables -v -L -n
 
  


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
IP Masquerading mugwump84 Linux - Newbie 5 05-03-2005 10:30 AM
IP Masquerading ? emailssent Linux - Networking 1 10-07-2004 11:49 PM
IP masquerading. somebody help me! Johnsernickle Linux - Networking 4 10-22-2002 07:57 PM
IP Masquerading kwigibo Linux - Networking 3 09-21-2002 08:46 PM
ip masquerading artman62 Linux - Security 5 08-13-2002 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:38 PM.

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
Open Source Consulting | Domain Registration