LinuxQuestions.org
Register a domain and help support LQ
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 01-30-2007, 10:15 AM   #1
matrixcubed
LQ Newbie
 
Registered: May 2004
Location: Gatineau, QC
Distribution: Ubuntu 6.10
Posts: 25

Rep: Reputation: 15
Unhappy Broken iptables config


Hi all,

This week, I had been fiddling with my iptables configuration, and I've inadvertently done something Bad(TM). As the system is right now, I am able to NAT anything coming from my network going to the internet, however any connection originating from the host will not even get to the ISP gateway.

I believe the problem is related to me dropping all configurations in the `nat` table, due to a bad rule I'd left hanging around some time ago, but I can't be sure.

iptables -t nat -F

I'm not sure what else I might have lost, nor do I know how to restore it.

Could someone describe the necessary iptables rule to be able to restore this type of connection?

Best regards,

Last edited by matrixcubed; 01-30-2007 at 10:24 AM.
 
Old 01-30-2007, 10:23 AM   #2
matrixcubed
LQ Newbie
 
Registered: May 2004
Location: Gatineau, QC
Distribution: Ubuntu 6.10
Posts: 25

Original Poster
Rep: Reputation: 15
This is an example of a (trimmed down) basic iptables script I use:

# LAN subnet
PRIVATE=10.0.0.0/24

# Loopback address
LOOP=127.0.0.1

# Ethernet interfaces
INET=ppp0
LAN=eth1

# Delete old iptables rules and temporarily block all traffic
iptables -P OUTPUT DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -F

# Set default policies
iptables -P OUTPUT ACCEPT
iptables -P INPUT ACCEPT
iptables -P FORWARD DROP

# Masquerade local subnet
iptables -t nat -A POSTROUTING -s $PRIVATE -o $INET -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
 
  


Reply

Tags
linux, networking, ubuntu


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
Where is the iptables config file? huxflux Suse/Novell 4 06-20-2006 05:24 AM
iptables config ? ryanjliles Linux - Networking 2 09-01-2005 04:45 AM
iptables module config swmok Linux - Networking 3 04-17-2005 08:42 AM
iptables Masquerade Broken in Mandrake 10? lnxconvrt Mandriva 7 06-10-2004 06:33 AM
iptables config - RTT Linux - Security 2 01-10-2004 02:40 PM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration