-   Linux - Networking (
-   -   Sharing a Dialup Internet Connection between Redhat Linux 9 and Windows XP (

nitpil 03-16-2004 01:09 AM

Sharing a Dialup Internet Connection between Redhat Linux 9 and Windows XP
I recently installed Red Hat Linux 9.0 and I connect to the internet using a dialup connection. Now I would like to share this dialup connection with a laptop using Windows XP. I used Windows XP on my computer for connection sharing and everything works. I am not sure whether the same question was asked before since I could just find similar things but not using a dialup connection. As a starter to linux, I don't know exactly how I can share an internet connection.

My situation is this :
I connect to the internet using a dialup modem
My computer has an ethernet card (eth0) which is connected to the laptop using a crossover patch cable
Now I need to setup my linux box in such a way that the laptop user can start accessing the internet from my linux box whenever a dialup connection is present.

I will really appreciate it if someone can explain me step by step as to what has to be done to get this thing working.

Thanx a lot in advance.


nitpil 03-18-2004 04:03 PM

Still waiting desperately for an answer. Experts out there, please help !

Tiyogi 03-18-2004 07:20 PM

Hi nitpi,

Sorry to say it but it seems like some question just go unanswered around here.
I would like to help you with your problem but I am just starting off in the wonderful world of linux.

However I do know that they make a dialup modem that you can share a dailup.
I think it is a Best Data. I saw it at Circuit City a few weeks back.
but I can not say if it was Linux compatible.

Like you I also would like to share a dail up modem. I am running Win98 on my other machine and its Zoom modem has a "Call waiting " feature that I need to keep out of trouble with the wife.

My Linux current modem( Intel ham) is supposed to have "modem on hold" but I cannot find any way of turning it on in Linux. It is a semi-controller not a controller-less like most Winmodems.

I am attempting to figure out a program called Samba-Swat it is used to set up computers so that they can talk to each other.. I must be a little slow because the instruction to it seem like they are written in Greek and of course I do not speak Greek.

Well good luck sorry I could help you maybe the modem I mentioned will work out for you.

nitpil 03-18-2004 10:02 PM

Hi Ed,
Thanx a lot for replying. I am glad that someone replied. But actually I don't have any problems with the hardware. I have a controller based modem which linux has already detected and I can use dialup internet connection using linux very well. It even detects the ethernet card. What I need to know exactly is how to configure everything so that an other user who uses windows XP can access the internet through my linux computer which is directly connected to the internet via a dialup connection.

If you or anyone can answer the question, I will be really thankful since we have just 1 dialup connection in my dorm room and I have to share it with my roomie.


kevlarx 03-19-2004 12:37 AM

you will have to do something called ip masquerading
start by enableing forwarding and masquerading
open the /etc/sysconfig/network file as root in any text editor and add the line GATEWAYDEV=ppp0
turn on IP packet forwarding by opening /etc/sysctl.conf file as root and edit the line to say net.ipv4.ip_forward = 1
now i assume that you already have static IP addresses on your lan so with that in mind
if you are using iptables type the following as root
#iptables -t nat -A POSTROUTING -o ppp0 -j masquerade
#iptables -A FORWARD -s (laptop adderss here) -j ACCEPT
#iptables -A FORWARD -d (laptop adderss here) -j ACCEPT
#iptables -A FORWARD -s !(laptop adderss here) -j DROP

now backup your iptables
#cp /etc/sysconfig/iptables /etc/sysconfig/iptables.old
#iptables-save > /etc/sysconfig/iptables

restart your network
#/etc/init.d/network restart
and restart iptables
#/etc/init.d/iptables restart

now set your windows boxes gateway to your linix boxes ip address and enter the DNS addresses you use and you are good to go

-kevlarx :-)>

nitpil 03-20-2004 03:07 PM

Thanx for the reply. I did exactly as you said but still it is not working.
I am giving the specific details below :

I have assigned static IP's to my linux desktop and the laptop as follows:

Red hat Linux 9 desktop :

IP Address :
Subnet Mask : (am not sure whether this is the right one to assign)
Default Gateway Address : have left blank, should I give something here?

Windows XP laptop :

IP Address :
Subnet Mask : (I tried entering, but windows pops up a windows saying IP address has to be contiguous, what should I put)
Primary DNS Server : (I have given the IP address of my linux box, I am not sure whether this is the one to put in this field)

After this I tried pinging one machine from the other,but it doesn't work. Then I did all the things u said about NAT and Masquerading. I also checked the new iptables file to see whether everything is reflected correctly and it is fine.

If you can tell me what could be wrong and how to do the static IP address thing on both the computers, it would be really great.

Thanx in advance.


kevlarx 03-20-2004 11:28 PM

your subnet mask should be on both computers and the DNS is the one you use for the internet on your linux box this should solve your problems let me know how things turn out

-kevlarx :-)>

tvn 03-21-2004 01:33 AM

I also used to use ipmasq to share dialup (painfully slow). But anyway I don't use Redhat so I don't know about specific config file but just want to point out that on the client computer (your Xp machine), the default gateway should point to the server ip which is in your case. And yes, the 1st & 2nd dns for the Xp client are the dns's your isp gave you.

nitpil 03-21-2004 10:12 AM

Thanx kevlarx and tvn. I went one step further now it seems. The 2 machines can talk with each other. I tried pinging one machine from the other and it works. But still the Windows XP box can't access the internet from the linux box. I first thought it might be a problem with DNS resolution. So I just opened a command window and tried pinging a valid IP address and it says destination net unreachable.

Also I had a problem typing 1 line u said kevlarx. I am pasting the output below:

[root@localhost root]# iptables -A FORWARD -s ! -j DROP
iptables -A FORWARD -s cat /proc/sys/net/ipv4/ip_forward .168.0.2 -j DROP
Bad argument `/proc/sys/net/ipv4/ip_forward'
Try `iptables -h' or 'iptables --help' for more information.

Is the ! sign used to indicate that packets from IP addresses not equal to should be dropped?

I also guess still there is some problem with DNS. I am using a dialup connection. Can you also tell me how to get the DNS address of my dialup connection ISP? I actually used 'dig' and got something but am not sure whether that is right. So let me know how to get the DNS address.

I guess I will wait to get a reply now before I proceed.

nitpil 03-21-2004 11:43 AM

It is working now guys !!! I guess I figured out what the problem was. As of now, I have disabled the firewall in my linux box as there were rules to drop some packets from specific ports. And now everything works. The only weird thing is I am not able to ping anything from my linux box or from the XP laptop. It just gives the output saying
icmp packet is filtered. Maybe the upstream router is not giving echo packets back due to NAT translation or something like that. Anyways, the XP laptop can now use internet using my linux box. Also it is very easy for the linux box to access the network from the XP box. All I had to do is setup internet sharing in Windows XP which gives an IP address of to its ethernet card and then I setup that to be my gateway and it works. So XP automatically takes care of NAT, iptables etc.

But I guess getting a feel of how these things work and doing it ourselves is much more fun.

Thanx especially to kevlarx for helping me out with this. U guys Rock :)

Take care,

All times are GMT -5. The time now is 10:31 PM.