Click to See Complete Forum and Search --> : Sharing Cable
Dre2002
03-20-2002, 10:17 PM
I'm complete newbie with Linux, How do I share my cable connection with 2 other computers? I have 2 PCs and a Laptop, I like to use one of the PC as the server/router, will I be able to install Mandrake on that machine and share connection with the other comps?? the other 2 computers are running WinXP pro.
KensLinuxMachine
03-20-2002, 10:48 PM
Sure.
I don't know exactly what you have for equipment, so I'll assume just the PCs each with 1 network card apiece in them...
Take one PC (from this day forward known as Linux Box) and add a second network card to it. Preferably a compatible one :) This will leave you with 2 ethernet cards (one for internet, one for local network). Install your Favorite Linux Flavor.
eth0 (most likely your internet connection) should be setup to use DHCP. Use the information for DNS, etc that your ISP told you to use. You'll probably also need to give them the MAC address of eth0. Your internet connection will probably fail until then. (If you need the address, you'd run ifconfig from the shell to see it).
That would mean that eth1 is your local network. This should have an address statically assigned to it by you. Most people use 192.168.1.1 or 192.168.0.1 or something along that line... I use 172.27.14.1. For the sake of argument, we'll use 192.168.1.1 as the IP address, with a subnet mask of 255.255.255.0 ...and no default gateway.
Then, you can get a hub (they sell 4 or 5 port mini hubs pretty cheaply. Make sure it's 10/100), and hook up the other 2 (windows) pcs to it as well as the eth1 port of your linux box.
On each windows machine, they'll need TCP/IP to have an address on the same subnet as eth1, with eth1's address as the default gateway. So we'll static address those (since there are only 2).
Call the laptop 192.168.1.2 for the address, 255.255.255.0 for the subnet mask, and 192.168.1.1 for the default gateway. As far as DNS goes, unless you're setting up DNS on your own server (something I haven't tried), you should point them to the DNS servers that your ISP gave you.
The final PC should be the same as the laptop, only you can use 192.168.1.3 for the IP address.
After everything is set up, you can restart the network on the linux box, and try to ping an outside address. If you can get out from the Linux box, that means that eth0 is working correctly (ifconfig eth0 will also show the address assigned to you by the ISP). Then try pinging the same outside address from each windows pc, and if you get to it, you should be able to get out onto the net with ease.
...that's the basics of getting it hooked up, but there's plenty you can do after such as getting a firewall script going etc. My explanation was probably rambling, but hopefully somewhat coherent. If I screwed up anywhere... I'm a newbie too :)
-Ken
[ 20 March 2002: Message edited by: KensLinuxMachine ]
jscott
03-20-2002, 10:48 PM
Although I won't even go into the security part of this any further -- Mandrake will probably be running a hell of a lot [on default install] that you don't need/want on a exposed router.
Yes, you'll need 2 NICs in the mandrake box. The cable modem goes into one NIC, and connect the other NIC to a cheap [read: 5 port] hub. You'll connect your other two machines to the hub.
See http://www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO/index.html or the simple version http://www.linuxdoc.org/HOWTO/Masquerading-Simple-HOWTO/index.html at linuxdoc (http://www.linuxdoc.org)
If you go to the Networking Linux postings you find the below.
Try this URL it may be a bit out dated but has the basics of what you want.
<http://www.linuxnewbie.org/cgi-bin/ubbcgi/biggrin.gif> http://www.linuxjournal.com/article.php?sid=3546
Try this one also: http://www.linuxdoc.org/HOWTO/Net-HOWTO/index.html
;)
toolshed
03-21-2002, 05:35 PM
I think one of the greatest things i have bought for a computer is a router.....
router are dirt cheap down....by a router and all problems now and in the future will be solved...at least that is my experience.
i got a linksys/switch router over a year ago for about $100 and now there like 70....
especially if others come over...trading mp3 and such...