LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-28-2008, 04:56 AM   #1
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Rep: Reputation: 15
Host not reachable when adding alias to lo


Hi All.
I'm sorry if my problem is being caused by my ingnorance.

I have a host with IP 172.18.0.43/23 which is perfectly pingable.
Now, if I add to that host an IP alias on lo then the host is unreachable.

ip addr add 172.18.0.44/23 dev lo:0

What could be the reason for this?

Thanks in advance.
 
Old 10-28-2008, 05:25 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, after such an action it decides to send all packets inside subnet (including ones to the router, including ping replies) through loopback. These attempts fail, because loopback interface doesn't allow packets to leave the box.
 
Old 10-28-2008, 05:48 AM   #3
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
Excuse my ignorance, but why is this so?
And how can I avoid this while still using an alias on localhost.

Thanks!
 
Old 10-29-2008, 12:58 AM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Why do you want to have an alias assigned to loopback?
 
Old 10-29-2008, 01:52 AM   #5
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
If the alias is the same as another subnet on another interface, you can bet data will not be reliably routed to that interface.

I can't see what you hope to accomplish by aliasing 'lo' - other than interfering with your routing.
 
Old 10-29-2008, 06:24 AM   #6
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
I have a load balanced setup of two Apaches.
The user connects to a virtual IP (say 1.2.3.4) and gets 'balanced' to one of the Apaches.
In order for the Apache server to be able to accept connections from the virtual IP, an alias should be created, so that it is actually able to listen on that IP.
In all guides that I have read on load balancing, they specify that this virtual IP should be created as an alias on lo. Don't ask me why...

Since it is giving that many problems, I tried adding it to tunl0, which seems to be working perfectly.

I don't understand why all tutorials mention to add it to lo:0 while this causes that many problems. Any clues?

Btw, if someone could explain what exactly is going wrong during routing, I'd appreciate. Not that I still need the alias on lo, but I'm interested in understanding why it is not possible/recommended.

Thanks for your replies.
 
Old 10-29-2008, 04:42 PM   #7
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, adding with netmask /32 would probaly also help.

The problem with routing that I don't like is that you have 2 IP's on different devices inside the same subnet. Subnet means that sending data is simple - just send it directly over the medium used by interface that has IP in subnet. Everything is worse when you have two devices on the same subnet and on different physical layers...
 
Old 10-29-2008, 05:45 PM   #8
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by raskin View Post
Well, adding with netmask /32 would probaly also help.

The problem with routing that I don't like is that you have 2 IP's on different devices inside the same subnet. Subnet means that sending data is simple - just send it directly over the medium used by interface that has IP in subnet. Everything is worse when you have two devices on the same subnet and on different physical layers...
That's something that I didn't know.
I thought that it would send a packet from the interface where the program is listening on, and not from another interface, although it's in the same subnet.

I mean, if I have 2 servers running on my machine, on the same subnet, I expect that responses will be send from the interface where the request arrived. I still don't really get the problem...guess my networking skills are way below zero
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Alias - Adding Command with Arguments bichonfrise74 Linux - Newbie 2 10-23-2008 01:29 AM
Adding an alias w3bd3vil Linux - Newbie 1 01-28-2008 04:17 PM
adding IP alias to eth0 via SSH? natv Linux - Networking 4 02-21-2007 04:02 PM
Adding a host alias in /etc/hosts tortle SUSE / openSUSE 3 12-05-2005 10:53 AM
adding perm. alias to .bashrc Lleb_KCir Linux - General 7 12-09-2004 02:35 PM

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

All times are GMT -5. The time now is 01:50 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