3

I asked this on another site recently, but I figured this might be a good place to ask this as well:

Please take a look at the diagram below. My question is in regards to computer "C" in the middle of the diagram. It has three NIC cards. It needs to be able to talk to computers A1, A2, A3, B1, B2, and B3. To do that, I will need to put static routes into computer C's route table. My question is what are the exact static route entries that I need to put into the route table to achieve this? In other words, what does "route print" look like after I have entered the static routes?

This would be on Windows 7 or Windows XP

http://i.stack.imgur.com/L2Kby.jpg

Edit: I should say I've done quite a bit of research on this, but I'm still a little shaky on the exact entries to achieve this.
This link from Microsoft is helpful with examples - but it is not totally clicking for me

newmanth
  • 3,913
  • 4
  • 25
  • 46
jstevens13
  • 145
  • 1
  • 1
  • 5
  • What are the IP addresses of Router A and Router B? Are RouterA and router B the default GW for Networks behind them? – Doon May 18 '12 at 17:42
  • Sorry I should have put that in. Every router port would be the .1 address for the network that it is connected to. So on router A, the port that is facing switch A1 would be 192.168.1.1. Therefore, computer A1 would have 192.168.1.1 set as its default gateway. – jstevens13 May 18 '12 at 18:48
  • I assume those are just placeholder addresses, but just in case they aren't: you shouldn't be using 172.168.x.x on your internal network; that address space is on the public internet, [owned by AOL](http://whois.arin.net/rest/net/NET-172-128-0-0-1/pft). RFC1918 ranges (10/8, 172.16/12, 192.168/16) and addresses you own are the only addresses you should ever use. – Shane Madden May 18 '12 at 20:14
  • Shane - Those are placeholder addresses - but thank you for the heads-up! – jstevens13 May 18 '12 at 21:09

2 Answers2

2

A quick stab with the following assumptions:

Router A has IP address: 192.168.4.1, and has correct routes/or its default pointing to 192.168.4.10
Router B has IP address: 172.168.4.1, and has correct routes/or its default pointing to 172.168.4.10    

You need to route 192.168.1.0/24 and 192.168.2.0/23 to 192.168.4.1 You need to route 172.168.1.0/24 and 172.168.2.0/23 to 172.168.4.1

so

  route -p add 192.168.1.0 MASK 255.255.255.0  192.168.4.1
  route -p add 192.168.2.0 MASK 255.255.254.0  192.168.4.1 
  route -p add 172.168.1.0 MASK 255.255.255.0  172.168.4.1 
  route -p add 172.168.2.0 MASK 255.255.254.0  172.168.4.1 

The -p will make them persistent across reboots.

Doon
  • 1,441
  • 9
  • 9
  • To reply to your first assumption: yes the port or router A that is facing computer C would have an IP address of 192.168.4.1 and the port of router B that is facing computer C is 172.168.4.1. The routers are already setup to route between all 4 of their ports respectively. – jstevens13 May 18 '12 at 18:52
  • I'm not sure I understand your second assumption though (and maybe this was just a type-o) but all subnets are /24 subnets. So to restate the second assumption. I need computer C on its 192.168.4.10 interface to be able to talk to computers on 192.168.1.0, 192.168.2.0, 192.168.3.0 networks as well as, on its 172.168.1.10 interface to be able to talk to computers on 172.168.1.0, 172.168.2.0, 172.168.3.0 networks. – jstevens13 May 18 '12 at 18:58
  • i was just making sure that the routers could already talk both ways. The /23 is a covering route, just a more efficient way of saying 192.168.2.0/24 and 192.168.3.0/24 but you could easily just route them all by /24 (Sorry I am mostly a Network wonk, so always try to aggregate routes wherever possible). – Doon May 19 '12 at 01:26
  • @jstevens13: Remember, it won't do much good for C to be able to reach a machine if those machines can't reach C too. So you'll need to add static routes on the default gateways of each network that needs tor each C. – David Schwartz May 19 '12 at 04:38
  • @Doon I understand completely now. Thanks for the explanation and the answer! – jstevens13 May 19 '12 at 12:27
  • @DavidSchwartz You are right, I should have put default gateways in the drawing for computers A1-3 and B1-3. Their only network connection each is the one shown in the diagram and each router routes between all networks it is connected to, so them having a default gateway of the router they are connected to would allow them to reach the C computer. – jstevens13 May 19 '12 at 12:29
  • @jstevens13 what David is saying is that without the same routes I have listed above pointed 10.10.10.10 on routerC, they will not be able to talk directly to the internet (They may not need to talk to internet, but just in case) – Doon May 19 '12 at 22:49
  • @Doon Thank you. Computers A1-3, B1-3 do not need to talk to the internet. Only computer C. – jstevens13 May 21 '12 at 16:59
0

A /23 would leave out the 192.168.3.0 network.

A /23 will not include the 192.168.3.0/24

You need to configure the route using 192.168.0.0/22 to include all three.
So:

Route -p add 192.168.0.0 MASK 255.255.252.0 192.168.4.1

Or separate :

Route -p add 192.168.1.0 MASK 255.255.255.0 192.168.4.1
Route -p add 192.168.2.0 MASK 255.255.255.0 192.168.4.1
Route -p add 192.168.3.0 MASK 255.255.255.0 192.168.4.1
kenlukas
  • 2,886
  • 2
  • 14
  • 25