LinuxQuestions.org
Help answer threads with 0 replies.
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 03-29-2007, 04:00 AM   #1
Syathon
LQ Newbie
 
Registered: Mar 2007
Location: UK, Norfolk
Distribution: Fedora, opensuse
Posts: 14

Rep: Reputation: 0
problems with internet connection sharing via a usb modem


Hello all.

On my network I have always used windows xp to share my internet connection to 3 other pc's. But I now wish to switch the "internet server" to linux (opensuse 10.2).

I have managed to setup my modem (alcatel speedtouch 330 usb modem) to connect to the internet, which was fairly painless.

However... I cannot seem to share this connection to any of my other machines on my network. I have sieved through forums and tutorials for well over a week now and haven't had much luck.

I have tried various commands to attempt masquerading but nothing gives.

ifconfig outputs:

eth0 Link encap:Ethernet HWaddr 00:13:A9:09: D9:B9
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::213:a9ff:fe09:d9b9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:70966 errors:0 dropped:0 overruns:0 frame:0
TX packets:115104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4975908 (4.7 Mb) TX bytes:84069967 (80.1 Mb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:222 errors:0 dropped:0 overruns:0 frame:0
TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15434 (15.0 Kb) TX bytes:15434 (15.0 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:**.**.**.*** P-t-P:194.145.148.98 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:7151 errors:0 dropped:0 overruns:0 frame:0
TX packets:5006 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:8339268 (7.9 Mb) TX bytes:540082 (527.4 Kb)

if anyone can please help me that would be great.

Thanks in advance

Last edited by Syathon; 03-29-2007 at 04:14 AM.
 
Old 03-30-2007, 04:59 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
To "share" a connection you have to do two things:
  • Enable ip-forwarding
  • Provide a MASQUERADE rule in iptables.
I don't what, if any, GUI tools might be available for this, but from the command line you could put the following in a startup script (perhaps rc.local if your distro uses it):

Code:
sysctl -w net.ipv4.ip-forward=1
iptables -t nat -A POSTROUTING -i eth0 -o ppp0 -j MASQUERADE
You will also need to make sure that the network interfaces are configured on the machines that will use this. Either you will need to configure them manually (if they aren't already) or else you will need to run a DHCP server.

Last edited by blackhole54; 03-30-2007 at 05:00 AM.
 
Old 03-31-2007, 05:15 AM   #3
Syathon
LQ Newbie
 
Registered: Mar 2007
Location: UK, Norfolk
Distribution: Fedora, opensuse
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the quick reply, I'll try this as soon as I can.

At current the other machines are configured manually to connect through a windows xp machine. For example:

IP: 192.168.0.2
subnet: 255.255.255.0
gateway: 192.168.0.1

is this still sufficient for connecting through the linux box once its setup?
 
Old 03-31-2007, 07:41 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Syathon
is this still sufficient for connecting through the linux box once its setup?
It looks to me like you're good to go!

Edit: Maybe I was too hasty. You will need to provide them with addresses for one or more DNS servers it you want them to be able to find anything on the Internet. (Maybe you have already done this and you just neglected to list it.) It might be in a different tab or dialog box from IP/subnet/gateway.

Last edited by blackhole54; 03-31-2007 at 07:47 AM.
 
Old 03-31-2007, 01:53 PM   #5
Syathon
LQ Newbie
 
Registered: Mar 2007
Location: UK, Norfolk
Distribution: Fedora, opensuse
Posts: 14

Original Poster
Rep: Reputation: 0
Yeah sorry I do have the DNS also set to: 192.168.0.1
 
Old 03-31-2007, 03:53 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well what does and doesn't work? i'd not be suprised if was actually just dns... you've not mentioned if your main box has a dns server running on it. try pinging google.com by ip address not by dns name for example.
 
Old 03-31-2007, 04:45 PM   #7
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Syathon
Yeah sorry I do have the DNS also set to: 192.168.0.1
Unless you have a DNS server running on 192.168.0.1 that won't work. For simple set-ups, you would usually set the DNS directly to your ISP's DNS servers. If you don't know what these are, you can usually find out by examing the system logs on the box that is making the connection.
 
  


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
internet connection sharing through a modem... rosssax Linux - Networking 3 08-05-2004 10:02 PM
Internet connection sharing help...using USB modem & Network card Daz155HGT Linux - Networking 6 04-28-2004 01:44 PM
Internet Connection Sharing Problems gbrad Linux - Networking 6 09-18-2003 12:28 PM
internet connection sharing with modem Sathe Linux - Networking 0 10-03-2001 09:00 AM
sharing internet connection(modem) linuxfan Linux - Networking 3 10-20-2000 04:53 AM


All times are GMT -5. The time now is 08:54 AM.

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