?
Solved

Network card route

Posted on 2007-11-28
14
Medium Priority
?
643 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
Limited time offer using promo code EXPERTS30

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through September 15, 2017, Experts Exchange members get 30% off the US7220 on the ATEN USA eShop using promo code EXPERTS30.

 
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 375 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: rfc1180
The Maximum Segment size (MSS) is an important consideration when troubleshooting connectivity via the Internet/Intranet. As the packets are routed via the Internet/Intranet, the packets must traverse through multiple routers in the path between two…
When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

770 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