Weblog entry #5 for lykwydchykyn

delay when using 2 IPs
Posted by lykwydchykyn on Fri 19 May 2006 at 04:51
Tags: none.
I've played around with putting two IP's on a NIC before (e.g. -- eth0 & eth0:1), but I never could get use out of it because whenever I do it it seems to cause a delay when accessing network services, either from the box or to the box.

Well, now I have had to implement it for a server for actual reasons, and I'm wondering what exactly is causing this delay. I've observed it on at least 3 debian boxes, so I know it's not just a hardware issue or anything.

The delay seems to happen just on first access; once the service is accessed, there is no slowness; just an initial delay of 10-30 seconds.

The two IP's are on the same block, if it makes a difference, though I've observed it in situations where the IP's were on different blocks and at least once where there were two NIC's on separate blocks on the machine.

Anyone know what's up? Do I need to put in static routes or something?

 

Comments on this Entry

Posted by simonw (84.45.xx.xx) on Fri 19 May 2006 at 20:10
[ Send Message | View Weblogs ]
eth0:1 would be down to using "ifconfig" which is the wrong way, ifconfig is evil.

Install iproute and do an;

"up ip addr add dev $IFACE a.b.c.d/nm"
"down ip addr flush dev $IFACE"
In /etc/network/interfaces

I have many machines with many IP addresses running Sarge, and I see no delay.

My guess would be something is doing a DNS lookup and timing out, check the reverse lookup of IP addresses is right.

Possibly there any other kit in the way? I'm thinking router or firewall, or maybe even a switch, doing something daft with arp requests.

Be aware that where the addresses are on the same IP block that routing out may be not exactly what you expect.

[ Parent | Reply to this comment ]

Posted by Anonymous (66.236.xx.xx) on Fri 19 May 2006 at 22:30
Thanks! I will check into iproute on Monday.
Is the "ip addr" part literal, or do you mean I should put the actual ip in there? I guess I should read the man page :-).

[ Parent | Reply to this comment ]

Posted by SaintAardvark (207.194.xx.xx) on Sat 20 May 2006 at 00:03
[ Send Message ]
I'm with you: DNS or ARP would be my guess. It'd be interesting to run tcpdump on both of those interfaces and see what's going on.

[ Parent | Reply to this comment ]

Posted by sebastian (212.238.xx.xx) on Tue 23 May 2006 at 14:29
[ Send Message | View sebastian's Scratchpad | View Weblogs ]
How do I see the list of IP adressed with the "ip" command?

With ifconfig I only see the first IP address.

Cheers, Sebastian

[ Parent | Reply to this comment ]

Posted by simonw (212.24.xx.xx) on Tue 23 May 2006 at 16:43
[ Send Message | View Weblogs ]
ip addr list

The command has built in help, especially for syntax type issue.

[ Parent | Reply to this comment ]

Posted by sebastian (82.134.xx.xx) on Tue 23 May 2006 at 19:19
[ Send Message | View sebastian's Scratchpad | View Weblogs ]
Yes i'm sorry :) wasn't realy familiar with the command. Why is this way to manage IP addresses better then de ifconfig way? I read about is a few time but couldn't find a real reason.

Cheers, Sebastian

[ Parent | Reply to this comment ]

Posted by simonw (84.45.xx.xx) on Tue 23 May 2006 at 20:40
[ Send Message | View Weblogs ]
My blog entry shows the kind of deception that "ifconfig" will pull on you. The problem is the aliasing "ethN:M" is not how the networking code works any more, and any mental model you build based on the ifconfig commands you type for aliases will likely be misleading.

Although experience dictates any mental model you build about how IP networking works is likely to differ from the source code (unless you are Alan, or Rusty, or other kernel network hacker, when you probably correct the source code to conform with your mental models).

If you have one NIC and one IP address, you don't need to care.

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search