Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2nd Network card default gateway

Status
Not open for further replies.

mlazlo

MIS
Oct 3, 2001
27
US
Is there a way to set a default gateway for a Unix Sco OpenServer v5 that has multiple network cards? When I do a "netstat -r" the line for the destination of "default" is set to a 10.x.x.x default gateway address with flags "UGS" on interface "net1". My problem is that another card in this machine has its ip address configured with 172.16.x.x. This works fine but it does not have a default gateway. How do I setup a default gateway for this 172.16.x.x card when the "default" destination already exists? Thanks in advance.
 
A default gateway is a *default*- the address used when there's no apparent route for the desired address. Unless you want to run something like gated (and I'm pretty sure you don't), that's all you get. You don't need another gateway for the second card- traffic that's supposed to go in that direction will.

I think you perhaps don't understand routing- I have a basic intro at Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Tony,
Thanks for the response. Also I do understand routing, but my problem is that these 2 subnets don't route between each other. This second card is attached to a subnet that will allow VPN traffic into our company. For the time being this network card(172.16.x.x) will be accessible through a VPN tunnel. The interface to the firewall that is designed as the "trusted" interface is on the 172.16.x.x and is acting as the default gateway to this subnet. This encrypted "tunnel" to a company whos internal address is on the subnet of 192.x.x.x. When I create this tunnel and assign the ip address that the Unix box will have to a NT workstation instead for testing, with the unix card not connected, this tunnel works. I can ping the 192.x.x.x and ftp into one of there machines. The network cards on this unix box have a default gateway of 10.x.x.x. This default gateway does not know what to do with a 192.x.x.x destined packet; but the interface on the firewall that allows and dis-allows VPN traffic does. This 172.16.x.x card is not going to act as a gateway between the 10.x.x.x subnet and 172.16.x.x subnet.
So, after this explanation here is what I have and need. I have a unix box that has 3 network cards. Cards 1&2 are on the subnet 10.x.x.x and the 3rd is on 172.16.x.x. These 2 subnets don't know about each other, for the time being. I can ping anything, from the unix box on the 172.16.x.x subnet, of course. But when I say ping 192.x.x.x I want the this unix box to say since this is not on one of my subnets send it through the 172.16.x.x card to the interface of the firewall , it knows what to do.
Now a default gateway may not be the answer with multiple cards, but I will need to tell the unix machine to route traffic through the 172.16.x.x card when it needs to get to an address of 192.x.x.x. Maybe I should create a route from the 172.16.x.x card to the subnet 192.x.x.x? Is this the only solution?
I don't know if this rambling helped at all but it is what it is; a problem. Thanks again in advance.
 
>Now a default gateway may not be the answer with multiple
>cards, but I will need to tell the unix machine to route
>traffic through the 172.16.x.x card when it needs to get to
>an address of 192.x.x.x. Maybe I should create a route from
>the 172.16.x.x card to the subnet 192.x.x.x? Is this the only
>solution?

That's the solution:

route add 192.168 0.0 172.16.x.x
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Oh, and of course the 172.16 also needs a route to the 192.168 network..

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Tony,
Thanks for the response. Can't I add a static route in this machines routing table that says route to the destination of 192.x.x.x from the gateway of my firwall interface 172.16.x.1?
The command netstat -r returns a table which has "Destination", "Gateway", ..., & "Interface". Would I need the "Destination" is the address 192.x.x.x, the "Gateway" to be 172.16.x.1 (the firewall trusted interface) and the "Interface" being in my case net2(172.16.x.10)?
See in NT you can add a default gateway for each card in a machine. Maybe that is my problem, thinking along the lines of NT? ;-)
Since I only need to get to 1 ip address 192.x.x.x adding a static map sounds like the way to go?
Thanks again for all your help.
 
Thinking NT will always get you in trouble :)

Seriously- even between Unixes, things you think you know from one can get you in deep trouble on another. Even when the command seems to do the same things, read the man page- sometimes the differences are subtle but important.
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Tony,
After looking at the man pages on "route" it isn't clear to me how to add a route to a specific network card.
route add 192.x.x.x 172.16.x.1
is what I have so far. But will this be able to distinguish between card 10.x.x.200 which shows up as "Interface" net1 and card 172.16.x.10 which is net2?
Thanks again.
 
You said you understand routing, but it's apparent you are unclear on at least some parts of it.

Please go read
Your question as it stands just doesn't make any sense, sorry. You are confused about something, and I'm not entirely certain where- that's why I'd like you to read that page and then if you still don't get it, come back and rephrase your question.


Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top