LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-28-2005, 03:12 PM   #1
sra
LQ Newbie
 
Registered: Aug 2005
Location: Lahore, Pakistan
Distribution: X/OS linux
Posts: 2

Rep: Reputation: 0
route command help connecting two windows networks


I am using X/os enterprise linux 4 but the problem I have is a simple routing problem as I am new to linux that is why I have no idea how to go about it.

I have two ethernet cards in my Linux server one is eth0 having the ip 192.168.1.6 which is further connected to a switch1 and the my windows network 1 is connected to the same switch and I also have a cable modem whose output is connected to a broadband router 192.168.1.254 and it also serves as my DNS server as well as gateway and one of the outputs from that router is also connected to switch1. which serves as internet provider to the network1. Squid is also setup on eth0.

eth1 whose ip is 192.168.2.1 is connected to switch2 and my windows network 2 which has two computers running win xp and both windows network1 and 2 are on a same workgroup "splus" and both eth0 and eth1 are using ip forwarding.

I cant seem to connect to the internet unless I specify a proxy in my windows network2 which is 192.168.2.1 port 3128. secondly it only works on the browser and no other service on the internet works. thirdly I want to see and share files with windows network1 and 2 workgroups which I cant do at the moment.

I want to use linux machine to be used as a router so that I can see all the information on windows network

windows network 1 ips:
192.168.1.2 to 6

windows networks 2 ips:

192.168.2.2 to 3.

Some people tell me that route command will do the trick for me but I dont know how need of desperate help.

Razi
 
Old 09-28-2005, 04:15 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Linux box should have
route add -net 192.168.2.0 netmask 255.255.255.0 dev eth1
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0
route add default gw 192.168.1.254
I think it's quite clear. First two networks are set up, then -- default gateway.

Now, it may work just this way. It may not. It depends on the broadband switch. It may handle only 192.168.1.x network, not 192.168.2.x. You may look into its manual and see if it has NAT on only 192.168.1.x subnet or you can also set it up to deal with 192.168.2.x. If you go for two-networks option, remember to set up routing table in the broadband router -- add 192.168.2.0 with netmask 255.255.255.0 and gateway 192.168.1.6

If your broadband router can only handle one network, you need to set up NAT on the Linux box. Write if you need it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to route internal Networks by IP tables? quazidaniel Linux - Networking 4 10-12-2005 11:32 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 05:34 AM
can't route/ping between networks ender03 Linux - Networking 21 02-01-2005 07:14 AM
Setting up Static Route for two Networks ctrylace Linux - Networking 2 07-23-2004 04:18 AM
Two networks - one route out diveguy Linux - Networking 5 08-29-2002 06:36 PM

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

All times are GMT -5. The time now is 05:21 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