LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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-16-2004, 01:09 AM   #1
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
Sharing a Dialup Internet Connection between Redhat Linux 9 and Windows XP


Hello,
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.

Nitin
 
Old 03-18-2004, 04:03 PM   #2
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Still waiting desperately for an answer. Experts out there, please help !
 
Old 03-18-2004, 07:20 PM   #3
Tiyogi
Member
 
Registered: Nov 2003
Location: Hyde Park, Ny
Distribution: Ubunta
Posts: 117

Rep: Reputation: 15
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.
 
Old 03-18-2004, 10:02 PM   #4
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
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.

Thanx,
Nitin
 
Old 03-19-2004, 12:37 AM   #5
kevlarx
LQ Newbie
 
Registered: Mar 2004
Location: PA USA
Distribution: Red Hat
Posts: 2

Rep: Reputation: 0
Nitin,
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 :-)>
 
Old 03-20-2004, 03:07 PM   #6
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
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 : 192.168.0.1
Subnet Mask : 192.168.0.255 (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 : 192.168.0.2
Subnet Mask : 255.255.255.0 (I tried entering 192.168.0.255, but windows pops up a windows saying IP address has to be contiguous, what should I put)
Primary DNS Server : 192.168.0.1 (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.

Nitin
 
Old 03-20-2004, 11:28 PM   #7
kevlarx
LQ Newbie
 
Registered: Mar 2004
Location: PA USA
Distribution: Red Hat
Posts: 2

Rep: Reputation: 0
Nittin,
your subnet mask should be 255.255.255.0 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 :-)>
 
Old 03-21-2004, 01:33 AM   #8
tvn
Member
 
Registered: Mar 2004
Posts: 96

Rep: Reputation: 15
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 192.168.0.1 in your case. And yes, the 1st & 2nd dns for the Xp client are the dns's your isp gave you.
 
Old 03-21-2004, 10:12 AM   #9
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
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 !192.168.0.2 -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 192.168.0.2 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.
 
Old 03-21-2004, 11:43 AM   #10
nitpil
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Heyyyyy,
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 192.168.0.1 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,
Nitin
 
  


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 from Windows XP to Linux Patchy Linux - Networking 2 09-21-2005 03:02 PM
Trouble with Internet connection sharing between Windows XP and Linux DownloadTHIS Linux - Networking 1 08-28-2005 07:45 PM
windows to linux internet connection sharing slow Acetylcholine Linux - Networking 0 05-26-2005 12:58 AM
Internet connection sharing between linux and windows mdkusr Linux - Networking 4 11-09-2004 01:27 AM
sharing internet connection between linux and windows homer_3_16uk Linux - Networking 1 03-21-2004 01:23 PM


All times are GMT -5. The time now is 09:29 PM.

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