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 a network consisting of a D link router and three host machines via wired ethernet and one host machine via wireless pc card. The network is 192.168.1.0/24. I had to run a very long ethernet cable to one of the machines so I can use it downstairs. I am thinking of adding another PC downstairs but I dont want to run another mile of cable. Rather I was thinking of putting an extra card in the machine downstairs so another machine can connect to it and to the network. Basically one of the host machines I have now need to be converted into a sort of router. Bridging the two ethernets would accomplish this but I was wondering if it was possible to setup something with the use of the route command instead. (I am trying to understand the theory behind it and have a basic understanding currently). The host machine in question has an IP of 192.168.1.4. Lets call it myrouterpc for simplicity. The d link router has an IP of 192.168.1.1.
IF I put the new PC in a different network, lets say 192.168.2.0 then on myrouterpc, I have to set one ethernet to IP 192.168.2.1 on the 192.168.2.0/24 subnet. Then I have to create a route in each of the other machines in the 192.168.1.0/24 to send packets destined for 192.168.2.0/24 to 192.168.2.1. Then also on the 192.168.2.0/24 network, I need to create a route that sends packets destined for 192.168.1.0/24 network to 192.168.1.4. On both subnets, the machines in each will have a default route to 192.168.1.1 so I can access the internet. Is this correct?
If I decide that I will just have one network the 192.168.1.0/24, then how might I do this with the route command. Can myrouterpc have two ethernet cards with addressess belonging to the same network? (example, 192.168.1.4 and 192.168.1.5). Or should I have them configured to have the same 192.168.1.4 address?
Thanks for any info?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
There is a much, much simpler way to accomplish this. Buy a small switch (or hub, if you must) and run the cat5 cable from your upstairs router to the new switch (downstairs). Plug both downstairs machines into the switch.
Also, assuming your router does WiFi, you could get a wireless bridge and place it downstairs. You should be able to configure the bridge to connect to the wireless router, then have both downstairs machines use the bridge. That could get a little more complicated, and you would want to be sure you had really paranoid security on the wireless link (strong WEP keys, etc).
It amazes me how sometimes the simplest solution escapes me. Thanks for the advice, I still would want to know if the routing scenario I described would accomplish the same thing just to improve my understanding of how networks work. Lately I have been very interested in routers.
Well if your using windows machines it is also possible to run direct cable connection(using usb, serial and cat5). But this method is mostly used for transferring files not internet connection.
For windows to a linux computer run Forward internet connection on Windows 2000.
Linux can do foward internet connection heard it is hard.
Hub or switch is the easiest and best way to share internet connection. But it would be advised to run another line or drop to have a back up line in case you loose one of the two lines. Sometime in the next few weeks I need to get up in the attic and run more lines too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.