Static IP Address on Ubuntu 12.04 Virtual Machine
Posted
by
chrisnankervis
on Ask Ubuntu
See other posts from Ask Ubuntu
or by chrisnankervis
Published on 2013-11-13T10:00:26Z
Indexed on
2013/11/13
10:11 UTC
Read the original article
Hit count: 290
I've setup a VM running Ubuntu 12.04 specifically for local web development and am having some problems ensuring it has a static IP address. A static IP address is important as I'm using the IP address in my hosts file to assign a .local suffix to addresses used both in browser and to connect to the correct database on the VM.
Currently, every time I connect to a new network or my VM is assigned a new IP address I need to reconfigure my whole environment which is becoming quite a pain. It also probably doesn't help that the default-lease-time
on the Ubuntu VM is set to 1800 by default.
At the moment I'm using VMWare Fusion and the Network Adapter is enabled and set to "Autodetect" under Bridged Networking.
I've tried to set a static IP address within the dhcpd.conf using the code below:
host ubuntu {
hardware ethernet 00:50:56:35:0f:f1;
fixed-address: 192.168.100.100;
}
The fixed-address
that I've used is also outside the range specified in the subnet block (which in this case is 192.168.100.128 to 192.168.100.254).
I've tried adding and removing the network adapter and restarting my Mac after each time to no avail.
Below is an ifconfig
of the VM that might be of some help:
eth0 Link encap:Ethernet HWaddr 00:50:56:35:0f:f1
inet addr:192.168.0.25 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe35:ff1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1624 errors:0 dropped:0 overruns:0 frame:0
TX packets:416 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:147348 (147.3 KB) TX bytes:41756 (41.7 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Are there any specific issues with 12.04 that I'm missing? Otherwise has anyone else got any ideas?
Thanks in advance.
© Ask Ubuntu or respective owner