# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcp auto eth0:1 iface eth0:1 inet static address 10.0.0.x netmask 255.255.255.0
ip addr list dev eth0 results
root@server:~# ip addr list dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff inet 10.0.0.x/24 brd 10.0.0.255 scope global eth0:1 inet 10.0.0.y/24 brd 10.0.0.255 scope global secondary eth0 inet6 xxxx/64 scope link valid_lft forever preferred_lft forever
Note the "secondary" on eth0.
How do I make this primary?
The issue I have is this: I use nsupdate with dhcp3 server to maintain a dynamic bind9 DNS service on my network. This works well, machines coming up on DHCP get given names and static machines don't (suggestions here for static names on DNS set by local /etc/hostname?).
This means I can connect internally to static machines via their DHCP IP and name and can set up external NAT routing for machines via their secondary static IP.
Unfortunately using a tool such as Ganglia (system monitoring and trending) delivers metric data via UDP broadcast and records this centrally via the source IP address.
In this instance the source IP address is the static IP (alias) rather than the DHCP IP which is attached to the name, so all my DHCP-ONLY machines show in Ganglia with names and all my DHCP+Static machines show in Ganglia with their IPs - obviously IPs are not very descriptive.
I want both my DHCP-ONLY machines and my DHCP+Static machines (all contain a DHCP address on eth0) to use their DHCP address on outbound connections (eth0:1 secondary, eth0 primary).
How do I configure this?