Solved

Network card route

Posted on 2007-11-28
14
640 Views
Last Modified: 2013-11-09
Hi,

I have one computer (A) with 2 NIC's
192.168.1.X
192.168.2.100

I have another computer (B) with 1 NIC
192.168.2.50

CompA can see the 1.X network and 2.X fine
CompB can see CompA which is fine also

Is there a way for CompC on the 1.X range to see the 2.X network.
CompC only has one network card.

Is there a way to add a route on the NIC or something.  I know i can install another NIC for the 2.X range.  But i am wondering if there is a way for one network card to ping or communicate with both 1.X and 2.X range thru the network.  at the same time.  

thanks
0
Comment
Question by:rick81
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 21

Expert Comment

by:from_exp
ID: 20371664
you have to configure comp C with network of 1.X range, with default gateway pointing to 1.100 (if that is an IP of PC A)
sometimes your should also enable or allow routing to be done on PC A
0
 
LVL 6

Author Comment

by:rick81
ID: 20371710
ok if i do that though will comp C still be able to access the internet, network shares, etc
and if so it will be running everything thru compA is that right? will this affect performance?

i thought there might be some sort of script.  all i wont to do is access a network share from 2.X range from compC (1.X).  would someone know how to write a script so that when i clicked on the shortcut to compB it would use compA gateway.  and when not in use it would use the normal routing.

thanks
0
 
LVL 21

Expert Comment

by:from_exp
ID: 20371774
don't know about the script, but if your pc C already has it's primary ip address with default gateway set to access internet and you want it to go to network 1.x via pc A, then you should do on pc C:
route add 192.168.1.0 mask 255.255.255.0 192.168.1.100

if you want to have this route even after pc reboots use -p flag
route -p add 192.168.1.0 mask 255.255.255.0 192.168.1.100
0
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 
LVL 6

Author Comment

by:rick81
ID: 20371802
below are the actual ip's.  (A) has two NIC cards

A - 192.168.0.100/192.168.2.100
B - 192.168.2.50
C - 192.168.0.9

I want to access B from C.
tried the route
route add 192.168.2.50 mask 255.255.255.0 192.168.0.100
gave a mask error?  any ideas
0
 
LVL 21

Expert Comment

by:from_exp
ID: 20371810
route add 192.168.2.0 mask 255.255.255.0 192.168.0.100 shoud work

please also provide me with ipconfig output on all 3 pcs
0
 
LVL 6

Author Comment

by:rick81
ID: 20371833
PCA
192.168.0.100 255.255.255.0 192.168.0.1
192.168.2.100 255.255.255.0

PCB (not sure on g/way)  this is a linux box
192.168.2.50

PCC
192.168.0.20 255.255.255.0 192.168.0.1
the route added successfully and i can ping 2.100 (B) but not 2.50(C)
0
 
LVL 6

Author Comment

by:rick81
ID: 20371851
as PC A is connected to the 1.X network it pings its other 2.X address.  With or without the route from PC C
0
 
LVL 21

Expert Comment

by:from_exp
ID: 20371878
you don't need to add any routes to PC A
on pc B you shoud execute also route command with route to PC C:
route add 192.168.1.0 mask 255.255.255.0 192.168.2.100
0
 
LVL 6

Author Comment

by:rick81
ID: 20371900
yeh i didnt add a route to PC A

i cannot add a route to PC B as it is a linux box.  I have no idea here.
looks like im stuck on this one.
0
 
LVL 21

Expert Comment

by:from_exp
ID: 20371920
on linux you should type:
route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.2.100

don't give up there ;)
to get information of ips configured on interface in linux:
ifconfig
netstat -in
to get routes:
netstat -rn
0
 
LVL 6

Author Comment

by:rick81
ID: 20371928
thanks.  i dont have access to the linux box as yet.
will get back to you.  thanks so far.

0
 
LVL 6

Author Comment

by:rick81
ID: 20371961
if i had another NIC in the linux box (B)
and had it set as 192.168.1.XX

then any pc on the 1.XX network could access it.  aswell as (A) and (B) on the 2.X range.

is that correct?
0
 
LVL 21

Expert Comment

by:from_exp
ID: 20372034
yepp, correct, but you should also consider correct routing:
every host should have route to particular subnet, otherwise packets will be sent to default route.
so when you add new subnet behind any new PC our router, all PCs should understand where to sent packets for that new subnet. Thats why you use route add command
0
 
LVL 11

Accepted Solution

by:
sysreq2000 earned 125 total points
ID: 20391730

There are 3 issues here:

1. Computer A needs to be capable of routing packets from one NIC to another. (this is assuming there is no other way to get from 1x to 2x)

2. Computer C needs to know which way to go to find the 2x network. Assuming the default gateway on computer C is NOT computer A, then you will need to give it the route.

3. The computers on the 2x network need to know how to get to the 1x network, so they can respond to computer C.

So,

step 1

I'm assuming computer A is a Windows XP Pro machine. You need to enable IP Routing so that computer a will forward packet between NIC's. If it's no XP pro then google IP Routing for that OS and I'm sure you'll find a how-to.

For XP Pro:

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To enable TCP/IP forwarding, follow these steps: 1. Start Registry Editor (Regedit.exe).
2. In Registry Editor, locate the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
3. Set the following registry value:
Value Name: IPEnableRouter
Value type: REG_DWORD
Value Data: 1
A value of 1 enables TCP/IP forwarding for all network connections that are installed and used by this computer.  
4. Quit Registry Editor.


Step 2, again assuming it's windows:

From a command prompt on computer c:

route add -p 192.168.2.0 mask 255.255.255.0 192.168.0.100

Step 3:
You get the idea. Let know if you need help for computer B or other computers on it's network.

If computer A is the Default Gateway for all computers then you don't need all the static routes added, just make sure A is capapble of forwarding packets.

Hope that helps.
0

Featured Post

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you with short command examples how to obtain a packet footprint of all traffic flowing thru your Juniper device running ScreenOS. I do not know the exact firmware requirement, but I think the fprofile command is availab…
Broadband over Power Lines Broadband over Power Lines is the technology of transmitting computer data through power lines. This method of connectivity allows the user to have access to the internet without having to rely on additional cables, suc…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question