Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Two PC's "A" and "B" are connected on the office LAN network having ip address range like 199.63.31.X.

"A" has 2 NIC cards in it - One connected to the LAN (199.63.31.x) and other connected(10.1.1.x) to PC "C" via a private hub.

"C" and "A" have a different ip address range : 10.1.1.X.

Is it possible to for m/c "B" to communicate with "C" via "A", considering "B" and "C" are on different ip address range?

share|improve this question

migrated from stackoverflow.com Dec 11 '09 at 9:40

This question came from our site for professional and enthusiast programmers.

This is possible. The most basic configuration that allows TCP/IP connections between your two networks is the following:

  • "A" needs to be configured to route between the two networks.
  • "B" needs a route telling it that "A" (199.63.31.x) is the gateway to network 10.10.1.0.
  • "C" needs a route telling it that "A" (10.10.1.y) is the gateway to network 199.63.31.0.
  • You probably need to add hosts entries on "B" and "C" so they can address each other by hostname. Without this, you must use IP addresses directly.

The exact steps needed will depend on what OS(es) these machines run. For example, Linux distributions put their hosts file at /etc/hosts; Windows machines use C:\Windows\system32\drivers\etc\hosts; Mac OSX uses /private/etc/hosts.

Other considerations you need to take into account are whether "C" needs to be able to access machines other than "B", if you care, or if "C" explicitly needs not to access other machines. You may also want to supply "C" with other services -- access to a DNS server, connections to a Windows Domain, or access to network file shares, for example. These are all possible, but you should know ahead of time exactly what you need to accomplish so you can configure "A" properly.

share|improve this answer
1  
remeber if it is windows you will have to use the ROUTE command.. IE Route add 10.10.1.x mask 255.255.255.0 199.63.31.x -p to make the gateways "talk" to eachother... i created some intresting routes with this .. one i vpn'd into a system . then with a route from the host computer i ACTUALY could access the ROUTER of the vpn system...very cool... – mike Dec 12 '09 at 6:25

You can do this if you install IP router software on A. Without knowing what operating system A runs, it would be difficult to recommend specific software.

share|improve this answer

As others said, you need setup routing software for "A".

For Linux use iptables. If you asked such a question here, this is not what you may want to mess with.

On Windows there is an easy way to use bridged connections. Google for that, it's really to setup using wizard.

share|improve this answer
    
iptables might be helpful here but it's not what is needed to enable packet forwarding on a linux kernel. at this juncture it's overkill. – quack quixote Dec 11 '09 at 10:37

An evil genius would use GNS3 to emulate a Cisco router/managed switch so that when you don't need to route using a computer, you can just copy the router/switch configuration over with about 3 seconds worth of downtime.

share|improve this answer

Why not just put in a hardware router? It looks like all network cables are already at A, so just put a router there, plug in A, B, and C. Every computer can be on the same network, which will simplify sharing files etc.

Routers are not terribly expensive, and it will get rid of:

  1. Configuring sharing between B and C
  2. Loss of connectivity when A is not turned on.
share|improve this answer

If you want to do it on windows, you can add a static route to each of your interfaces.

You'll have to add static routes to the IP Networks at each NIC from command prompt (or make a batch file to use only when required) :

route add destination-address mask subnet-mask gateway-ip

Example: let me assume that the ip address at the interface on A towards B is 199.63.31.55, and that towards C is 10.1.1.21

route add 10.1.1.0 mask 255.255.255.0 10.1.1.21

route add 199.63.31.0 mask 255.255.255.0 199.63.31.55

Or if you want to 'simulate' a router on your PC, use GNS3. Check this out:

http://commonerrors.blogspot.in/2015/08/gns3-tutorials-for-beginners-how-to.html

Place a router and connect two clouds to two of the router's interfaces. At the cloud configuration, assign each cloud an NIC from your PC. So now you have one cloud connected to each of the PCs NIC cards. Assign IP addresses on router and clouds. This basically results in both networks at your PC's NICs being connected to your router in GNS3.

share|improve this answer

You must log in to answer this question.