-   Linux - Newbie (
-   -   Multiple ips/gateways one NIC - Routing (

gsaminath 05-25-2009 12:20 PM

Multiple ips/gateways one NIC - Routing
Hi Team,

I need two logical interfaces & two gateways to be configured in one NIC.

One server with two logical interfaces eth0:0 & eth0:1 configured with two gateways in single physical eth0 interface (NIC)accordingly.

Requirement : We are trying to splitup eth0 into two logical interfaces & two separate ip segments to be used on those interfaces also with two different gateways accordingly.

Both ips needs to be reachable in the network.

If we are configuring like this eth0:0 interface ips services were not working. Please suggesst asap.

pls let me know is it possible on this? if so please provide us the config., or link.

FEDORA LINUX server (Kernel : Vmlinux2.6.5-1.358smp)

Saminath. G.

acid_kewpie 05-25-2009 01:10 PM

interfaces don't have default gateways, routing tables do, which are abstracted from physical interfaces. How are you expecting two default gateways to work? What information is supposed to be used to determine whether one is used over the other?

gsaminath 05-26-2009 08:02 AM

Multiple ips/gateways one NIC - Routing
Hi Chris,
I couldnt get your query right. All i am looing for is "whether we can have two logical interfaces configured using single physical interface for (ex)
eth0 --> physical interface ( no ip segment on this )
need to have two sub-interface under it

eth0:0 --- > segment X
where vlan 10 to be used in this interface

eth0:1 --- > segment Y
vlan 20 to be used in this interface

and have static route added say default route added pointing to nexthop(gateway) X and specific route added pointing to nexthop(gateway) Y ".

Also provide configuration template or reference link if possible.

JulianTosh 05-26-2009 09:33 AM

Like Chris was trying to clarify, "default routes" and "static routes" are different things. You can only have one "default route" - a route of last resort. You can have multiple routes off a network.

Simply by creating the logical interfaces, the system will create routes to the connected subnets. You would need to add "static routes" if one of those stub subnets had other subnets that needed to be reached.

For instance, given:
Internet <> nic0:0 - host - nic0:1 <> private_subnet1 <> private_subnet2

'host' would have a "default route" (thru nic0:0) to 'Internet' and a "static route" (thru nic0:1) to 'private_subnet2'.

acid_kewpie 05-27-2009 03:28 AM

you're talking about having aliased interfaces there, e.g. eth0:1 but using vlans on them. aliased interfaces are NOT vlans, they are just additional addresses on the same subnet, very very very different thing. You need to understand the difference and decide what you actually want.

All times are GMT -5. The time now is 11:41 PM.