Help - Search - Members - Calendar
Full Version: Networking Winxp Home To Mandrake 9.2
Linuxhelp > Support > Technical Support
wizbongre
Hi everyone, this is my first post here...

After putting it off for ages I've finally bitten the bullet and got my second PC up and running again with the intention of teaching myself all about Linux. I've installed Mandrake 9.2 on it with no problems so far, to sit alongside my main machine with XP Home installed. I have a cable modem connection to my ISP that I would like to share between the two machines but have a few questions!

Questions, questions...
Which machine would be better suited to being the main gateway to the internet? I assume the Linux based machine would be better... I suspect it would probably work better than the internet connection sharing tool in Windows. I get an IP automatically assigned to me by my ISP.

What hardware do I need to get the two machines talking to each other and sharing the internet connection? At the moment the Windows machine has two ethernet ports enabled, one connected to the cable modem and the other connected to the Linux box via a crossover cable.

Is the crossover cable correct for sharing the internet connection?

I have already had the linux box connected to the internet via the cable modem so I know that side of it all works. The main problem seems to be getting the two computers to share! When I run the internet connection sharing wizard in Win XP it finishes but says an error occurred - unfortunately it doesn't tell me what the error was!!

Any help or advice people can give me will be greatly appreciated. Thanks in advance.
Robert83
So,

Linux would be better for the gateway computer.

Based on you're current configuration, the crossower cable is good!

You need iptables, if you want to use Linux as the Gateway computer. See www.google.com iptables example

http://oceanpark.com/notes/firewall_example.html <--check this

Once you've done nating with Linux, manually edit you're winXP network properties.

For example
If you're Linux Gateway is 192.168.0.1
And you're Windows is 192.168.0.2

Then you're windows network setup should look like this

IP adress 192.168.0.2
Subnet Mask 255.255.255.0
Gateway 192.168.0.1
DNS 192.168.0.1 [if you use BIND] or use the DNS of you're provider.


Sincerely
Robert B


Sincerely
Robert B
shaggy999
It should be mentioned (in case it isn't obvious) that making your Linux box the gateway router means migrating one of the network cards from your Windows machine to the Linux box and setting it up. Personally for me, since I have a desktop, a file server, 2 SGI machines, and a laptop via wireless I went with a wireless router w/ 5-port switch.... cost me $100, but setting it all up was a snap. It's a decent option if you've got the money to blow, expecting to add more computers to your network in the future, and aren't as concerned w/ setting up a firewall as just getting out onto the net.
Robert83
Put another network card into you're linux box, configure eth0 using DHCP, and configure eth1 to 192.168.0.1.
And enable ipforwarding

edit /etc/rc.d/rc.local and ad the following line

echo 1 > /proc/sys/net/ipv4/ip_forward


Set you're WinXP machine to use 192.168.0.1 as the gateway, and enter the DNS of you're ISP.


Sincerely
Robert B
wizbongre
QUOTE (shaggy999 @ Feb 22 2004, 05:45 PM)
It should be mentioned (in case it isn't obvious) that making your Linux box the gateway router means migrating one of the network cards from your Windows machine to the Linux box and setting it up. Personally for me, since I have a desktop, a file server, 2 SGI machines, and a laptop via wireless I went with a wireless router w/ 5-port switch.... cost me $100, but setting it all up was a snap. It's a decent option if you've got the money to blow, expecting to add more computers to your network in the future, and aren't as concerned w/ setting up a firewall as just getting out onto the net.

Hi, good point! I hadn't thought about moving one of the NIC's across - although it isn't an issue. Fortunately both machines have ethernet built into the mobo with the extra spare as an expansion card which can be easily swapped.

My assumption of the Linux box being better is based on my readings and my initial desire to use Linux - that is is more stable and secure than Windows. Is this a fair assumption?!

I too plan to get a router set up (probably a combined ADSL modem and router and wireless access point actually) as I'm moving to a new property where I can't get cable internet so will move to ADSL. This initial step of networking the two directly with a crossover is just to help my understanding as I've not done any networking before... Hopefully the router will have a built in firewall, plus any firewall I implement in Linux.
wizbongre
QUOTE (Robert83 @ Feb 22 2004, 05:55 PM)
Put another network card into you're linux box, configure eth0 using DHCP, and configure eth1 to 192.168.0.1.
And enable ipforwarding

edit /etc/rc.d/rc.local and ad the following line

echo 1 > /proc/sys/net/ipv4/ip_forward


Set you're WinXP machine to use 192.168.0.1 as the gateway, and enter the DNS of you're ISP.


Sincerely
Robert B

Okay thanks - that seems almost straight forward :-)
Robert83
oh, and

also add this line into you're /etc/rc.d/rc.local

route add default gw 192.168.0.1

Sincerely
Robert B
Robert83
make that

route add default gw [the ip adress that is given to you by the ISP], the one for the cable modem.


Sincerely
Robert B
Robert83
at the end you're /etc/rc.d/rc.local should have these lines :

route add default gw [the ip adress of you're cable modem]
echo 1 > /proc/sys/net/ipv4/ip_forward



and windows

ip : 192.168.0.2
gw : 192.168.0.1

Sincerely
Robert B
wizbongre
Thanks again.

The only complication (or misunderstading I have) is how I make some of the settings for the IP address when my IP is dynamically allocated from my ISP and can change (in theory although not always in practice) once every 24 hours.

Does this make a difference?

Also, could someone recommend a good firewall for the Linux machine to keep me safe, and do people use anti-virus software on Linux machines?

Thanks.
Robert83
A good firewall , would be something with iptables, just www.google.com iptables example.
But there are some firewalls on iso, [but they require a computer for firewalling only], will search the net for some.

As for the viruses, they really don't mean to much for linux computers,...but in you're case, since you've got a windows computer on the net, you should have one, for example a free and easy to configure console firewall

BitDefender www.bitdefender.com


Sincerely
Robert B
Robert83
Hmmm, I think that thing with the IP does make a diference, but since my cable provider alocates me static private/public ip adresses, never had that problem.

Please wait for someone, who knows the answer.


Sincerely
Robert B
hughesjr
No real difference ... just set the internal card as a static IP (192.168.0.1) and set the external card to use DHCP ...

Iptables is a firewall ... when you have it working, the firewall is on!
-------------------------------------------------------------------------
In fact, mandrake 9.2 comes with a product called shorewall that automates a lot of the internet connect sharing process ...

Slap 2 NICs in the Mandrake box, hook up one to the cable modem (I would do that with the one that's eth1) and one to the XP box via a crossover cable (eth0).

Go to The Mandrake Control Center and click on Network and Internet ... select DrakGW answer a couple questions and you are done...

Reboot XP and you should be good to go and very protected....
wizbongre
Thanks to all the replies...

The last one makes the most sense (its less technical ;-))

I had noticed shorewall in the set up of Mandrake and also there is some mention of the bitdefender thing...

I'll let you know how I get on.

Have to say thanks though for some good help and advice - its a good indication of things to come on this forum!
Robert83
I guess I've complicated this thing for myself, now I don't know anything smile.gif)
messed up that thing with gw, and ip adresses smile.gif, sorry if I confused you


Sincerely
Robert B
wizbongre
Okay - I give up!

I've been through the following procedure and still can't get the two machines to share the internet connection...

I moved the extra NIC to the Linux box.
I disabled the NIC on the mobo of the linux box so it could only use one NIC.
I did a fresh install of Mandrake.
I configured the NIC (eth0) to work with my cable modem and access the internet. So far so good!
I then enabled the mobo NIC during a reboot. Mandrake noticed the new hardware and allowed me to install it correctly.
I set the IP of the second NIC (eth1) to be 192.168.0.1 with a static protocol.
The IP of eth0 is set to dhcp.
I then booted the XP machine and manually changed the settings for the network connection:-
The IP is set to 192.168.0.2.
The gateway is set to 192.168.0.1.

I can't get the XP machine to get onto the internet. I can ping each machine from the other one so I assume the network cable isn't faulty...

What am I missing?!
Robert83
Hi,

just did this XP to Linux then internet thingie today,

so you've got 2 ethernet cards in you're linux box...one is dhcp which goes for the net, and the other is 192.168.0.1 wich is internal.

LINUX MACHINE SETUP :

1.add this line to the /etc/rc.d/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forwad
2.enable iptables
3.make a file in /home for example iptables
4.add the following line to you're iptables file
iptables -A POSTROUTING -t nat -s 192.168.0.0/255.255.255.0 -o eth1 -j SNAT --to-source xxx.xxx.xxx.xxx [the gateway of you're ip adress [the one that is given by DHCP].

Windows Machine :

192.168.0.2
255.255.255.0
192.168.0.1
xxx.xxx.xxx.xxx [some DNS server]

This should work, and I think that you're gateway is always the same, only you're IP adress [from the isp side] changes daily.

Sincerely
Robert B
Robert83
almost forgot once you've created /home/iptables with that postrouting in it


type in console /etc/init.d/iptables stop
source /home/iptables
iptables-save > /etc/sysconfig/iptables
/etc/init.d/iptables start
wizbongre
QUOTE (Robert83 @ Feb 27 2004, 06:28 PM)
Hi,

just did this XP to Linux then internet thingie today,

so you've got 2 ethernet cards in you're linux box...one is dhcp which goes for the net, and the other is 192.168.0.1 wich is internal.

LINUX MACHINE SETUP :

1.add this line to the /etc/rc.d/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forwad
2.enable iptables
3.make a file in /home for example iptables
4.add the following line to you're iptables file
iptables -A POSTROUTING -t nat -s 192.168.0.0/255.255.255.0 -o eth1 -j SNAT --to-source xxx.xxx.xxx.xxx [the gateway of you're ip adress [the one that is given by DHCP].

Windows Machine :

192.168.0.2
255.255.255.0
192.168.0.1
xxx.xxx.xxx.xxx [some DNS server]

This should work, and I think that you're gateway is always the same, only you're IP adress [from the isp side] changes daily.

Sincerely
Robert B

Thanks for the help...

A few more questions (don't forget I'm a newbie!)

How the hell do I log in as root to change the files - if I log in as just me it won't let me save the files! I have tried editing the file in kedit but keep getting a message that it can't make a backup of the file and then it can't save the file. I assume this is because of access rghts?
How do I enable iptables?

Thanks.
hughesjr
There are 2 ways to do the setup ... the manual way ... and by using drakgw.

Did you try the drakgw way yet?

Open Mandrake Control Center and select network then click on the internet gateway (drakgw) selection.....

You should be able to use the wizard to setup mandrake as a gateway PC....

This process will make the changes that robert mentioned and make your mandrake PC an iternet gateway, a DHCP server and a DNS server.....
wizbongre
Yep, done that (numerous times ;-))

I'm sure I'm missing something obvious.

Oh, and I figured out how to change to root user from the konsole, so I'm just trying some of the latest pieces of advice...
hughesjr
If you use the script here as is, it should work for you .... change the location of iptabes to:

IPTABLES=/sbin/iptables

follow the instructions and it should work...
hughesjr
you will have to manually add an IP address for your DNS servers in the XP machine .. use the values from your ISP.

If you don't have any to use, do the command:

cat /etc/resolv.conf

and use the IP address of the nameserver from that file as your DNS server....
wizbongre
Okay, I went to bed after my last post with a headache and no idea why it wasn't working...

Been reading the last few posts on my Linux box before getting to grips with it and thought I'd kick of the Win XP box for some background music... Well, wouldn't you know, I can now access the internet on the XP box. And I haven't changed anything!

All's well that ends well then! Just hope it stays like this!

Thanks again for all the advice and help :-)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.