Solved

Network card route

Posted on 2007-11-28
14
638 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New modem? 4 75
Joining Domain Issue 4 53
Flashing Cisco Meraki MR18 with OpenWRT firmware ? 5 307
Network Switch Connections 8 60
The following recovery method will work on All Cisco Switchs that run ISO software. You will need a good copy of the IOS version you want you use saved on your PC and a Com's Cable. The software for these switches comes as a .tar file. Tar is …
 One of the main issues with network wires is that you never have enough.  You run plenty and plan for the worst case but you still end up needing more.  What many people do not realize is with 10BaseT and 100BaseT (but not 1000BaseT) networks you …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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