LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-12-2009, 12:26 AM   #1
chymeira
Member
 
Registered: Dec 2008
Location: CH/IL
Distribution: Slackware 13.1 Fedora 12
Posts: 73

Rep: Reputation: 16
sharing internet connection


hello ,
i have a computer that is connected to the internet with usb - ppp0 ( usb -> dsl modem ) , and now i want to share that connection with my laptop .
i have ethernet cards on both computers and i was wondering how to connect them . ( i know i have to use NAT and set default gateways ) but i cant get it to work .
Thank you very much
 
Old 06-12-2009, 06:26 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by chymeira View Post
( i know i have to use NAT and set default gateways ) but i cant get it to work .
Why don't you tell us what you've already done. Remember that you must enable IP forwarding on the computer with the Internet connection. Also, make sure your firewall is not blocking things. (Check the FORWARD chain.)

Last edited by blackhole54; 06-12-2009 at 06:28 PM.
 
Old 06-14-2009, 01:00 AM   #3
chymeira
Member
 
Registered: Dec 2008
Location: CH/IL
Distribution: Slackware 13.1 Fedora 12
Posts: 73

Original Poster
Rep: Reputation: 16
This is what i have done so far :
$>echo "1" > /proc/sys/net/ipv4/ip_forward

i have two interfaces : ppp0 which is connected to the internet and eth0
$>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

for my other computers , the default gateway is my eth0 .
im not sure if i have all the needed modules loaded , can u plz list them . I havnt changed anything in my iptables . Can you also tell me what i have to add there ?

thank you very much for the help
 
Old 06-14-2009, 05:04 PM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by chymeira View Post
This is what i have done so far :
$>echo "1" > /proc/sys/net/ipv4/ip_forward

i have two interfaces : ppp0 which is connected to the internet and eth0
$>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

for my other computers , the default gateway is my eth0 .
Thank you.

You also need to make sure the other computers have correct values for the DNS servers. The easiest thing (with just a few computers) is to set these to the same values as your gateway machine (the one with the DSL connection). There is probably a way to do this with GUIs. Or it might just be easier to copy the /etc/resolv.conf file from your gateway machine to each of the other machines (must be done as root).

If/when you have DNS set up correctly, if it still doesn't work, please post the results of:

Code:
route -n
iptables -nvL FORWARD
(The iptables command must be run as root. Any user may run the route command.)


Quote:
im not sure if i have all the needed modules loaded , can u plz list them .
I have never explicitly loaded modules for this. (Some are automatically loaded as a result of iptables commands.) For some purposes you may need to explicitly load some modules, but for simple browsing you shouldn't need to.
 
  


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
Internet Connection Sharing starmonche Linux - Networking 7 02-16-2007 05:08 PM
SHaring internet connection bart59 Linux - Networking 1 01-27-2005 07:24 AM
Internet Connection Sharing quozt Linux - General 7 09-08-2003 09:06 PM
Internet Connection Sharing... again schuelerj Linux - Networking 5 05-13-2003 06:45 PM
Internet Connection Sharing joe7.1 Linux - Newbie 0 02-07-2002 12:25 AM

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

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