Solved

Network card route

Posted on 2007-11-28
14
634 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Author Comment

by:rick81
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 21

Expert Comment

by:from_exp
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

 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 …
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now