LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2003, 10:46 PM   #1
cmisip
Member
 
Registered: Aug 2002
Posts: 189

Rep: Reputation: 30
Turn a host pc into a simple router ?


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?
 
Old 07-03-2003, 12:16 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
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).
 
Old 07-03-2003, 04:49 PM   #3
cmisip
Member
 
Registered: Aug 2002
Posts: 189

Original Poster
Rep: Reputation: 30
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.
 
Old 07-03-2003, 05:13 PM   #4
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Sure you can make a linux box a router! In fact, they made damn fine routers! Firewalls too!

See this Linux Mag article for more than you want to know about routing.

There is a floppy based distro of Linux called Coyote Linux that is made just for firewall/routing. Many others too like Astaro Linux . Check out Linux Router Project and search on Freshmeat for many more.
 
Old 07-03-2003, 10:19 PM   #5
ckone
Member
 
Registered: Mar 2003
Location: el paso
Distribution: Redhat, Suse, and freebsd
Posts: 90

Rep: Reputation: 15
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.


Well good luck later.....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't host server with firewall, but can with router, could use help please calimer Linux - Software 2 03-01-2005 09:15 PM
Router Virtual Host Problem E-Oreo Linux - Networking 1 09-15-2004 07:17 AM
How do i turn an old comp into a router? NovaWo1f Linux - Networking 5 06-04-2004 06:06 PM
How do I turn my main box into a router? jlturbos Linux - Networking 4 03-07-2004 12:21 PM
How Can I turn a Linux Red Hat into a ROUTER???? jasmine83 Linux - Networking 7 03-22-2003 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration