LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   problems with internet connection sharing via a usb modem (http://www.linuxquestions.org/questions/linux-networking-3/problems-with-internet-connection-sharing-via-a-usb-modem-541548/)

Syathon 03-29-2007 04:00 AM

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

blackhole54 03-30-2007 04:59 AM

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.

Syathon 03-31-2007 05:15 AM

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?

blackhole54 03-31-2007 07:41 AM

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! :D

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.

Syathon 03-31-2007 01:53 PM

Yeah sorry I do have the DNS also set to: 192.168.0.1

acid_kewpie 03-31-2007 03:53 PM

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.

blackhole54 03-31-2007 04:45 PM

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.


All times are GMT -5. The time now is 01:17 PM.