Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
2 Pages V   1 2 >  
Reply to this topicStart new topic
> Networking Winxp Home To Mandrake 9.2, How?!
wizbongre
post Feb 22 2004, 02:23 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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.
Go to the top of the page
 
+Quote Post
Robert83
post Feb 22 2004, 02:34 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
shaggy999
post Feb 22 2004, 05:45 PM
Post #3


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



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.
Go to the top of the page
 
+Quote Post
Robert83
post Feb 22 2004, 05:55 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 23 2004, 05:33 AM
Post #5


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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.
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 23 2004, 05:35 AM
Post #6


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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 :-)
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 07:00 AM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 07:05 AM
Post #8


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 07:09 AM
Post #9


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 23 2004, 08:01 AM
Post #10


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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.
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 08:18 AM
Post #11


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 08:19 AM
Post #12


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post Feb 23 2004, 08:38 AM
Post #13


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



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


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 23 2004, 09:47 AM
Post #14


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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!
Go to the top of the page
 
+Quote Post
Robert83
post Feb 23 2004, 12:27 PM
Post #15


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 27 2004, 06:20 PM
Post #16


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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?!
Go to the top of the page
 
+Quote Post
Robert83
post Feb 27 2004, 06:28 PM
Post #17


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post Feb 27 2004, 06:30 PM
Post #18


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
wizbongre
post Feb 27 2004, 06:36 PM
Post #19


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 22-February 04
Member No.: 2,436



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.
Go to the top of the page
 
+Quote Post
hughesjr
post Feb 27 2004, 06:54 PM
Post #20


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



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


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 01:26 AM