Link to home
Start Free TrialLog in
Avatar of Sid_F
Sid_F

asked on

ADD STATIC ROUTE

Can anyone give me the exact line to add a static route for the following setup

My domain (192.168.16.X) access's the internet through a router withip 192.168.16.4 all users have 192.168.16.4 as there gatway.  I run a website  with a lan address of 10.0.0.1 which is connected to a router 10.0.0.2 which has a second address of 192.168.16.254 (connected back to my existing lan)

Basically I want any requests for 10.0.0.1 to go to 192.168.16.254 for the entire domain.  I believe if I make the change to the server 192.168.16.200 for the domain then the clients will automatically update as the server is set as there primary DNS
Avatar of Saineolai
Saineolai
Flag of United States of America image

Can you clarify whether you want to change DNS or you want to change your routing?

The best way to add a route for all machines on your 192.168.16.0 network to the 10.0.0.0 network would be to add a route on the default gateway router 192.168.16.4 which will direct traffic for the 10.0.0.0 network to the 192.168.16.254 router.

Making a change in DNS will change what the url resolves to but will not change how the traffic is routed to the server unless you also add a network address translation.
i agree with saineolai's idea of doing it with proper dns config.

also you are asking for a 'static route' which will not resolve your issue at all,,, static routes are for routing networks and/or subnets, not individual IPs.  i think what you are asking for is IP forwarding, which is completely different than static routing.  But as mentioned above, your problem can be resoved with proper DNS setup which is the proper way to do it.

ASKER CERTIFIED SOLUTION
Avatar of marce_lito
marce_lito

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sainei is right.

But, if you really really really want to create the route, you have to do it in all machines that need this access. Open command prompt and type the following:

route -p add 10.0.0.0 mask 255.0.0.0 192.168.16.254

-p will make the route permanent (even after a restart, it will remain)

This should work fine. But, again, the best is to configure this route on gateway.