LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-23-2004, 09:19 AM   #1
webcast
LQ Newbie
 
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
Exclamation net config


Hello,
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 192.168.0.1
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, 10:53 AM   #2
freeborn
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.
 
  


Reply



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

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

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