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 07-11-2001, 07:52 AM   #1
sromej
LQ Newbie
 
Registered: Jul 2001
Posts: 1

Rep: Reputation: 0
RedHat 7.1 iptables masquerade setup


I've been working for awhile trying to get an older machine I have to share my room's internet connection ( college-provided )

I used a simple set of commands to attempt this ( from yolinux.com ):

echo 1 > /proc/sys/net/ipv4/ip_forward - Enables packet
# Delete and flush. Default table is "filter". Others like "nat" must be explicitly stated.
iptables --flush - Flush all the rules in filter and nat tables
iptables --table nat --flush
iptables --delete-chain - Delete all chains that are not in default filter and nat table
iptables --table nat --delete-chain

# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT


After doing this, I *was* able to ping both internal machines, and they could ping eth1 ( the LAN card on the gateway ), but only the gateway machine could access the internet.

Is there anything I should have in 'netcfg', under the Routing tab?
Any other hints? ( so far I have eth0 set to DHCP, and eth1 set to no protocol, and I have enable routing, but not specified a default gateway )

I eventually want a stronger ruleset, but I need this working first.

Thanks.
 
Old 07-13-2001, 01:15 PM   #2
KevinJ
Member
 
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
Re: RedHat 7.1 iptables masquerade setup

Quote:
Originally posted by sromej

( so far I have eth0 set to DHCP, and eth1 set to no protocol, and I have enable routing, but not specified a default gateway )
Do you mean you have not set a default gateway for the internal machines? You will need that to be the internal NIC address in the Gateway machine.

KevinJ
 
  


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
MASQUERADE Target not found (IPTABLES) bksmart Linux - Networking 15 07-27-2005 08:57 PM
iptables masquerade deconfliction ttucker Linux - Networking 15 08-01-2004 06:04 PM
iptables Masquerade Broken in Mandrake 10? lnxconvrt Mandriva 7 06-10-2004 06:33 AM
iptables - true nat AND masquerade rebuke Linux - Security 3 11-11-2003 02:02 PM
Masquerade - iptables amphion Linux - Security 6 06-08-2003 09:59 PM

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

All times are GMT -5. The time now is 04:06 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