What's new

static routing

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

bwana

Regular Contributor
What is it and why is it used?
For example, my router gets its ip from verizon and hands out lan ips by dhcp.
If I turn off the dhcp hand off, then i assign static ips to my client machines. Where does static routing come into the picture and why does my router devote a whole section to setting up these static routes? Is it used if I have a second router in between my gateway to the net and my client machines? I thought double-NATting was frowned upon?
 
Static routing is typically used in scenarios when the router has more than one gateway to send traffic.

Example:

RouterA LAN Subnet 192.168.1.x
RouterA WAN IP 192.168.2.1
GatewayB WAN IP 192.168.2.2 **connected to 192.168.3.x**
GatewayC WAN IP 192.168.2.3 **connected to Internet**

A static route could tell the router to direct traffic destined for 192.168.3.x to GatewayB, instead of the default "all outbound traffic through Gateway_".
 
Example:

RouterA LAN Subnet 192.168.1.x
RouterA WAN IP 192.168.2.1
GatewayB WAN IP 192.168.2.2 **connected to 192.168.3.x**
GatewayC WAN IP 192.168.2.3 **connected to Internet**

A static route could tell the router to direct traffic destined for 192.168.3.x to GatewayB, instead of the default "all outbound traffic through Gateway_".

thank you. please clarify:
1)is the static route entered into Router A only?

2) how does router A know about 192.168.3.x subnet? Since its WAN IP is 192.168.2.1, why would it even get any traffic destined for 192.168.3.x ?

3)So, a static route requires a destination IP (how would 192.168.3.x be specified?), a subnet mask (255.255.255.0?), and a gateway ip (192.168.2.2). Again, how does router A even know that 192.168.2.2 exists? It knows its own ip(192.168.2.1) and it knows the subnet fow which it is doling out NATted ips (192.168.1.x)
 
1) In this case, yes (because the LAN subnet is behind NAT).
2) Static route. RouterA provides connectivity for LAN clients.
3) Previous example as static route (on RouterA):

192.168.3.0 255.255.255.0 192.168.2.2
(destination network) (dst network subnet) (gateway)
Different implementations may use a metric (to determine the best route) or allow you to specify an interface on Router A instead of the gateway IP (point to point links). The static route informs the router that 2.2 is a gateway, and the router also knows what networks it is directly connected to (1.x/2.x).
 
1) In this case, yes (because the LAN subnet is behind NAT).
2) Static route. RouterA provides connectivity for LAN clients.
3) Previous example as static route (on RouterA):

192.168.3.0 255.255.255.0 192.168.2.2
(destination network) (dst network subnet) (gateway)
Different implementations may use a metric (to determine the best route) or allow you to specify an interface on Router A instead of the gateway IP (point to point links). The static route informs the router that 2.2 is a gateway, and the router also knows what networks it is directly connected to (1.x/2.x).

Sorry but i am really befuddled now. I get this:
Internet-->GatewayC but its ip is 192.168.2.3 and that is a non routable address. Nothng connected to the net can have a nonroutable address. In this example, how are these routers exactly connected?
 
Nothng connected to the net can have a nonroutable address. In this example, how are these routers exactly connected?

Multiple interfaces. GatewayC could be performing NAT or it could be another device a dozen hops away. RouterA doesn't care; all it knows is that all traffic not in 1.x (LAN subnet) or 3.x (static route) is sent to GatewayC.

The private IP restriction is an oversimplification. It's not uncommon for ISPs to use private IPs in their infrastructure, which data to/from public IPs traverse without problems. Most people would consider this part of "the Internet." If you own the routers, you can route whatever networks you like. Just don't expect your neighbor (and the Internet at large) to accept invalid routing advertisements.
 
The only time you need to deal with static routing is in a multiple router situation. It has nothing to do with static IPs. The reason the feature is included in many consumer routers is that it's easy to throw in and gives vendors another feature to put in their brochures. It's rarely used in consumer applications.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top