LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2013, 05:47 AM   #1
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Rep: Reputation: 0
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
 
Old 02-01-2013, 02:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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
 
Old 02-01-2013, 10:28 AM   #3
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
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
 
Old 02-01-2013, 03:25 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
what do you mean? more words, spelt properly please.
 
Old 02-01-2013, 11:59 PM   #5
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
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
 
Old 02-02-2013, 02:26 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
route and alias interfaces in RHEL 5.5 earthlink Linux - Enterprise 3 04-14-2011 02:57 PM
HELP how to route IP alias to VM? outeredge Linux - Networking 0 04-08-2007 11:05 PM
unable to route with ip alias using one NIC simayi Linux - Networking 0 10-27-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration