Linux IP aliasing with single DHCP and single STATIC IP address

1

I'm working on an embedded system with a single physical ethernet device. Using aliasing, I'd like the device configured such that one static IP address (call it s.s.s.s) is ALWAYS available. The other interface can be

The following /etc/network/interfaces file was working for me for a while, until I realized a grave error...

#/etc/network/interfaces

#loopback interface, standard
auto lo
iface lo inet loopback

#this is the user-configurable dhcp or static primary interface
auto eth0
iface eth0 inet dhcp

#this is the ALWAYS available static interface
auto eth0:1
iface eth0:1 inet static
address s.s.s.s
netmask 255.255.255.0

The error here is that if eth0 is configured for DHCP and no DHCP server is available when the device comes up, then eth0:0 is not available.

I've also noticed that if eth0 is the s.s.s.s static interface and eth0:0 is the dhcp interface, then DHCP does not assign that interface an IP.

Is there any way to configure a system with a single physical interface the way I envision?

Chris

Posted 2015-01-16T15:17:08.367

Reputation: 11

No answers