Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two PC’s connected together with a cross over cable. One of the PC’s is running Windows 2000 Pro and the other is a Linux box. The Linux box has removable drives and I’m thinking of trying to setup Windows 2000 server on it also. I have a cable modem and share my Internet connection through the Windows 2000 Pro machine using ICS.
What I’d like to do is do away with the cross over cable and replace it with a hub or router. From my understanding with a router you can share files and Internet, but with a hub you can share files and to share your Internet connection you need a proxy server.
From what I know it sounds like I should buy the router, but a router cost $100 and a hub is $20. That a big difference for a starving student.
router comes with a built in firewall (NAT) a hub dosen't; but a hub will boost ur internet speed. To me they both do the same thing except for miner differences.
You basically have it right, save for that all hubs these days are really switches, but the jargon just hasn't kept up with the engineering. You can share the internet over a hub. You can turn the Linux box effectively into a Router using NAT/Masq. Its really easy. Actually, it was the first job I had for Linux at the time. Technically it can be done with only 1 NIC, but that makes for an armfull of packet collisions. Then again a NIC these days runs $5 used and $15 new. A second NIC and a hub, $35 or a el cheapo Linksys Router at around $80 (Pricewatch).
If I go with a hub will I still need the two nics in the Win2000 box for Internet connectivity for the Linux box? Or does the cable modem hook into the hub, along with my two PC's.
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602
Rep:
Basically:
A hub is very dumb. It is just a repeater. It takes wat it receives on one port and just sends it out the other ports.
A switch is a little smarter. It knows the MAC addresses of all the connected ports and unless it is a broadcast packet it will only send to the correct port. Some switches also come with the ability to make VLANS and other such fancy features.
A router can actually make decisions and can pass traffic between subnets.
These are somewhat simplified (on purpose), so if you want more details let me know.
Not unless you can get multiple IPs from your cable service, which I largely doubt, but there are a few that will do it, a rare few. Dual NIC'ing the Win box will work, and if you're more familiar with that, its probably more easily done. I recommend using the Linux box as the router as... well, to put it bluntly I distrust windows, and Linux makes for one heck of a router. There, I'm biased. The setup would be something like the following:
4-8 port hub
Dual NIC machine (either win or linux)
card 1: set-up to get the IP from the cable modem, DHCP, pppoe, whatever. Plugged directly into the cable modem.
card 2: running on a reserved subnet, 192.168.x.1 is the most common. Plugged into the hub.
Single NIC machine
card 1: set-up on another IP of 192.168.x.2. Plugged into the hub.
If The dual NIC machine is a Linux box, it would be very easy, i.e. 1 single line command of iptables to have it forward all traffic from any machine on the 192.168.x.x subnet (not all that secure, but you can tweak as you learn). Also its incredibly easy to set up a dhcp server so that IPs are handed out dynamically; making it so friends can bring over a linux/win/mac box, whatever and have internet connectivity in 1-2 minutes.
The same thing could probably be done easily enough with 2k server, but I have a P 133Mhz 24Mb RAM laptop that has been doing this exact job (with one end of the network being wireless), for 147 days of uptime.
Guys thanks for the great information. What I’m going to do is get the router, but before I do I’m going to buy the $20 hub and play around with it for a couple of weeks and see what I can make it do. My brother said he would buy it from me when I was ready for a router. I have to say this is a great forum.
With the hub, you can only connect machines that are on the same network/subnet, so you won't be able to directly connect your cable modem to it to share Internet access between your two computers. That's where the Linksys router that Finegan mentioned comes in. It's a gateway router with a built-in 4-port hub/switch, which means that you can connect up to four machines on your LAN to the hub, and the router part of it will take care of connecting those boxen to the the outside world via the cable modem. If you aren't eventually planning on using the Linux box as your firewall/router, you'll need a dedicated hardware router like the Linksys.
I've been using a Netgear RT314 gateway router for a couple of years, and it's been totally rock-solid. Setting the box up was a piece of cake, too. Friends of mine who use the Linksys say the same thing about that box.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.