LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Route Through an Alias Interafce (https://www.linuxquestions.org/questions/linux-networking-3/route-through-an-alias-interafce-4175447970/)

hesisaboury 01-31-2013 05:47 AM

Route Through an Alias Interafce
 
Hello
i have one interface with 2 different ip address :
eth0 ->ip-pub1/29
eth0:1 ->ip-pub2/30
now i want route my remote servers (public ip) through eth0:1

any suggestion

acid_kewpie 02-01-2013 02:26 AM

what does /29 and /30 signify here? These are different subnets? You can't do that. an aliased interface should be on the same network, otehrwise you're just breaking things left right and centre, even IF it appears to still work, it's AWFUL practise.

And routing tables define where to go next, not what local interface to use to get there. regardless of aliases interfaces and such, if you say that destination x is reached via next hop a.b.c.1 then it will have to use an interface ON that subnet, so if it has a.b.c.100 and a.q.r.123, it'll have to use the first one implicitly

hesisaboury 02-01-2013 10:28 AM

Thanks u acid_kewpie
what do u suggest if i change /30 to /29 and both have a same GW , now how can i route ?

Best Regards

acid_kewpie 02-01-2013 03:25 PM

what do you mean? more words, spelt properly please.

hesisaboury 02-01-2013 11:59 PM

hello,
i have one interface with two ip with diff subnet mask, and two gw , now according to your last post i have to change the second ip so both have the same subnet mask ,
OLD ==> eth0 -> /29 ,,,,, eth0:1 -> /30
NEW ==> eth0 , eth0:1 --> /29 ,, same GW

i want to route my remote server go through eth0:1
how can i do that ?

Best Regards

acid_kewpie 02-02-2013 02:26 AM

If you have two different internet connections, then you should have two different nics OR vlans on the switch. What you're doing will most likely work fine, but it's just very bad practise. You can leave it as is if you have no realistic option to improve it.


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