LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums HCL Reviews Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-12-2016, 04:56 AM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 108

Rep: Reputation: Disabled
Delay in bringing up additional external ip addresses from /etc/network/interfaces


Hi,
I've configured rednundant (VRRP) router based on two 16.04.1 Ubuntu. Everything except one thing is working as expected.

I have a few additional external IP addresses defined in /etc/network/interfaces:

Code:
auto eth0
iface eth0 inet static
        address x.x.x.53
        netmask 255.255.255.224
        network x.x.x.32
        broadcast x.x.x.63
        gateway x.x.x.33
        dns-nameservers 127.0.0.1 10.171.3.56 10.172.3.247
        dns-search domain.com

        up ip addr add x.x.x.34 dev $IFACE
        down ip addr del x.x.x.34 dev $IFACE
        up ip addr add x.x.x.39 dev $IFACE
        down ip addr del x.x.x.39 dev $IFACE
        up ip addr add x.x.x.40 dev $IFACE
        down ip addr del x.x.x.40 dev $IFACE
        up ip addr add x.x.x.48 dev $IFACE
        down ip addr del x.x.x.48 dev $IFACE
        up ip addr add x.x.x.50 dev $IFACE
        down ip addr del x.x.x.50 dev $IFACE
For obvious reason additional external addresses are the same for both routers, and are starting on boot. I've made a script running every 5 seconds on both routers to check if router is active, and in case if it is not then bring additional addresses down. This is working fine, but for some time after additional addresses on non-active router were up, I can't use these IP's on active router.

My idea is to remove that list from /etc/network/interfaces file and put them to the /etc/rc.local:
i.e. ip a a x.x.x.x/32 dev eth0 with delay of about 20 seconds.

But I am not sure when exactly rc.local script is running. Is it at the end of booting process or in the middle? Any idea how to sort it out?
 
Old 09-12-2016, 10:51 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,098
Blog Entries: 14

Rep: Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254Reputation: 1254
rc.local runs after all init scripts.

You may want to investigate the arping command.

I've not used VRRP but did want to mention an issue we had wherein we were floating an IP between servers. The IP would successfully be shutdown on one server and brought up on the other but traffic coming from separate VLANs wouldn't reach it. We found the issue was we have separate switches in each of our racks and those switches were seeing the change and updating arp cache for the appropriate hardware addresses (MACs). However, our core switches weren't seeing this change so were keeping the MAC from the server where we'd stopped the IP. We found using arping from the server we had just brought the interface up made our core switches recognize the move and update to see the other MAC.

In our case we didn't add any of this to rc.local - we have it all in separate init scripts we run. Additionally the init script checks to see if the IP is already in use and refuses to bring it up if so (on the assumption it was already started on the other host).
 
  


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
How to display a list of available network interfaces' IP addresses yrs7 Programming 5 06-08-2013 05:40 PM
Need a boot delay to wait for network interfaces jason_not Linux - Networking 2 12-19-2012 12:39 PM
Communication between two Network Interfaces (with IPv6 addresses) within same system peeyushpd Linux - Networking 2 03-18-2012 03:04 PM
xircom network modem pcmcia delay bringing steno Linux - Networking 1 04-02-2003 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration