Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to emulate the Amazon EC2 metadata service on my local system for testing. In EC2, this runs on 169.254.169.254. I understand that this is the designated range for pseudorandom local addresses on DHCP failure, but Amazon in their wisdom are also using it for this purpose, so I need to do the same thing.

I'm using F19 Alpha. In earlier Fedora, I could simply make a virtual interface on the loopback device, like lo:0 and assign that a static address using the normal ifcfg- scripts. Now, that fails with "Error: Connection activation failed: Device not managed by NetworkManager or unavailable".

(I'm running NetworkManager, but previously I was doing this underneath it.)

Is finding some way to continue what I was doing with lo:0 the right approach (and if so, how?), or is there a better way?

share|improve this question
    
Couldn't you do this with netfilter/iptables? Like NAT back to 127.0.0.1? –  goldilocks Apr 26 '13 at 20:26
    
@goldilocks why fake it when you can do it for real? ;) –  Tim Apr 26 '13 at 20:59

1 Answer 1

Haven't used Fedora in a while, but it should still be very similar to CentOS. I did this on CentOS 6.

Copy /etc/sysconfig/network-scripts/ifcfg-lo to /etc/sysconfig/network-scripts/ifcfg-lo:1

Your new config should look like so:

DEVICE=lo:1
IPADDR=169.254.169.254
NETMASK=255.0.0.0
ONBOOT=yes
NAME=loopback1

Restart the network service service network restart.

Bonne chance mon ami !

share|improve this answer
    
Unfortunately, this is exactly what I was doing and what was working but now isn't. –  mattdm Apr 28 '13 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.