Link to home
Start Free TrialLog in
Avatar of Alan Dala
Alan Dala

asked on

Static route for Public IP NIC

Hi,

I have a server with two NICs, one for the internal connection (192.168.1.2) and a second NIC for external connection (public IP). From what I understand, I need to set up static routes on the server since I can set only one 'default gateway." This is where the confusing part starts; is the static route set for the public IP address to see the internal network? I think I don't understand this well enough, hence the confusion. Any routing guru out there to help me shed some light on this process?

Thank you!
Avatar of Jorge Diaz
Jorge Diaz
Flag of United States of America image

Hi there,

what are trying to accomplish, also what os are you running on?
SOLUTION
Avatar of hypercube
hypercube
Flag of United States of America image

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
SOLUTION
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
Avatar of Alan Dala
Alan Dala

ASKER

Thank you for your responses. This server has a small website on it. One NIC is on the private network and the second one is in the DMZ. From what I understand, you set the gateway only on the private network NIC and set static routes for the public IP NIC to be able to route packets. Is that accurate?

Thanks.
I don't think it's completely accurate.  But then, I already commented on that...

IF it's the LAN gateway then no gateway address on the LAN NIC.
SOLUTION
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
I'm sorry if I don't explain this well enough. I have a web server that needs to be accessible internally and externally. I've setup one NIC with an internal IP of 192.168.1.2. I've added a default gateway of 192.168.1.1. Now, for the NIC in the DMZ, I've setup an ip address of 123.123.123.123. If I set another 'default gateway, I get the 'multiple gateways' warning message. I thought the only way to set the traffic to find both routes(internal and external) is by setting static routs through the command line. Is this accurate?


Thanks again.
You haven't revealed what the OS is or the services that are running.
For example, is this Windows with Internet Connection Sharing and, therefore, the computer *is* the internet gateway for the LAN?
Just an example of how the question might be answered of course .......

From what you've said:
192.168.1.1 is another device which is the internet gateway for the LAN.  
This computer doesn't *need* this gateway because the computer already has an internet connection.
So, perhaps you want the LAN NIC to have no gateway entered.
Then the public NIC will not only be the internet gateway for THIS computer but also will have its internet gateway address entered (likely from the ISP).
One is enough.

Then, packets from the LAN should be responded to on the LAN without a LAN gateway address.  The packets simply go out "on the wire" and reach their intended destination on the LAN.

If you run
route print (in Windows)
you should see a route:
0.0.0.0 [the public NIC address]
Removing the LAN default gateway and adding a gateway to the external one fixed the problem.


Thanks!
ASKER CERTIFIED SOLUTION
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