Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-23-2004, 10:19 AM   #1
LQ Newbie
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
Exclamation net config

i have this problem and i would like some help from someone who knows
i have a pc with a slack 9.1 and i would like to use it like a gateway to internet so i can serve 2-3 more pcs that i own.
i have a static ip and a dsl line. linux has 2 network cards
one of those has as real ip on internet 212.89.XXX.XXX and the other one that looks like
i want the pcs to have IPs in the form of 192.168.0.XXX . i want the pc which are on the same LAN with the linux one to use it as a gateway
thanks in advance
Old 08-23-2004, 11:53 AM   #2
LQ Newbie
Registered: Aug 2004
Location: Everett, WA
Distribution: Fedora Core 3
Posts: 15

Rep: Reputation: 0
here you are, man.

echo 1 >/proc/sys/net/ipv4/ip_forward # Enable IP forwarding
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT

where is eth0 - your network card, that has real ip on internet. eth1 - your network card which is connected to your lan. don't forget to put this as a startup script and to tell other machines the ip of your gateway.


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
net config regnier Linux - Networking 5 02-11-2005 09:34 AM
net config regnier Mandriva 9 02-11-2005 08:34 AM
Problem with net config mrant Slackware 4 06-04-2003 06:48 PM
Net card config ilyapap Linux - Networking 4 04-11-2003 04:47 AM
Net Config RUN Linux - General 4 07-16-2002 05:24 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:01 AM.

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