Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Configure a computer for 2 Default Gateways

In the scenario where I need a computer to have 2 Default Gateways , how should I  configure the computer to achieve this goal.
I know that there is Route Add command in windows that can add a second DG to the computer. However in large environment, is Adding Route to computers is done manually or through a script or it is a configuration done through a router ?

in the topology below, assuming computer C1 is configure with DG of R1 interface but it  also needs to reach Network 192.168.10.0.

How is this done ?

Thank you
dg
0
jskfan
Asked:
jskfan
  • 6
  • 5
  • 3
  • +3
11 Solutions
 
Neil RussellTechnical Development LeadCommented:
You can add a static route yes but NEVER try adding a second default gateway into a computer. You would need a router to split the traffic and not a gateway.
Replace SW1 with a router
0
 
mikebernhardtCommented:
If it's only one route then use route add to add it. Add the keyword Permanent or it won;'t survive a reboot.
0
 
Don JohnstonInstructorCommented:
Assuming that R1 can get to 192.168.10.0 network, it would send an ICMP network redirect to C1. Effectively telling C1 that the best way to get to the 192.168.10.0 network is to send it to 192.168.20.1  (this also assuming that redirects aren't disabled on R1).

If redirects are disabled, then R1 will simply forward all the packets to R2.

A computer can only have one active default-gateway.  Some systems let you define more than one, but only the first entry would be used.

If R1 doesn't know about the 192.168.10.0 network, then you would have to create a static route on C1 for the 192.168.10.0 network with 192.168.20.1 as the next hop.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
nucfissionCommented:
Hi jskfan,

rule of thumb - a single host must have only 1 Default Gateway. The idiom is " if the destination is not known then forward to the default gateway " but if system has 2 Default gateways ....er.... which gateway is to be used.

You can introduce Static routs on hosts to forward request for 192.168.10.0 network to R2. and you are right that you can actually do this through scripts.

However I would strongly recommend against this. all routing should be done through routers/switches - this way you do not have to make multiple changes if things change and go Desk diving to make sure everyone is working and/or applications have correct access.

If your SW1 is layer 3 capable -- you can simply introduce the routing there .. and use SW1 as the gateway.

but again the Routers R1 & R2 are also cable of routing between themselves; and you only have to maintain 2 routing tables .... rather than multiple hosts with static (Route add commands) routing table.

Hope this helps
0
 
jskfanAuthor Commented:
Don Johnston

If I understand:
 ICMP redirect is enabled by default on Cisco routers, the issue should not have happened at first place.  Correct ?
0
 
Neil RussellTechnical Development LeadCommented:
It all boils down to what SW2 is.  If it can not ROUTE then game over. You have two separate networks connecting to SW1, 10.10.20.0 and 192.168.20.0  can you log onto R1 and currently ping R2 ?
0
 
QlemoC++ DeveloperCommented:
Since there are transfer networks between SW1 and the routers, SW1 needs to be a L3 switch with routing capabilities.
0
 
Don JohnstonInstructorCommented:
ICMP redirect is enabled by default on Cisco routers, the issue should not have happened at first place.  Correct ?

What "issue"?  Is something not working?

You are correct, ICMP redirects are enabled by default.  But even if they aren't, R1 should still forward traffic to R2 (once again, assuming that R1 has a route to the 192.168.10.0 network).  If it doesn't (and you can't add it), just add a route to C1 (route add 192.168.10.0 mask 255.255.255.0 192.168.20.1).
0
 
jskfanAuthor Commented:
SW1 is L2.
I believe if SW1 was L3  then routing should have occured just there...
0
 
Don JohnstonInstructorCommented:
I believe if SW1 was L3  then routing should have occured just there...
That is correct. But the topology you have is not that unusual.
0
 
Neil RussellTechnical Development LeadCommented:
Why not just have SW1 connect only to R1 and R1 <===> R2.  You dont need any new hardware then.
0
 
Don JohnstonInstructorCommented:
jskfan,

I just noticed you have an IP addressing problem.  C1 and interfaces of R1, R2 which connect to SW1 must be on a common subnet.  For example:

R1 192.168.20.1/24
R2 192.168.20.2/24
C1 192.168.20.3/24
0
 
jskfanAuthor Commented:
I agree , C1 exiting Default Gateway or added DG through Route command,  should always be on the same subnet as the computer subnet.
0
 
Don JohnstonInstructorCommented:
Right. But your topology diagram show R1 with 10.10.20.1 and R2 with 192.168.20.1.

That won't work.
0
 
jskfanAuthor Commented:
It is made up scenario....just trying to understand the usage of Route Add command in windows.
I agree the subnets are wrong...
0
 
jskfanAuthor Commented:
Thank you Guys!
0
 
Don JohnstonInstructorCommented:
Okay, but if the underlying network is invalid then the concepts will be invalid as well.
0
 
QlemoC++ DeveloperCommented:
No doubt, Don.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 6
  • 5
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now