<p dir="ltr">Don't forget to add the options:</p>
<p dir="ltr">dns-nameservers<br>
dns-search</p>
<p dir="ltr">Otherwise you may not be able to resolve DNS.</p>
<p dir="ltr">Doug</p>
<div class="gmail_quote">On Oct 26, 2014 8:26 AM, "Dotan Cohen" <<a href="mailto:dotancohen@gmail.com">dotancohen@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I need to ensure that a particular machine has a static IP address. Is<br>
this the right way to configure /etc/network/interfaces?<br>
<br>
auto eth0<br>
iface eth0 inet static<br>
address 10.0.0.7<br>
netmask 255.255.255.0<br>
gateway 10.0.0.138<br>
<br>
The current configuration, using DHCP looks like this:<br>
$ ifconfig<br>
eth0 Link encap:Ethernet HWaddr 90:2b:34:a9:c5:ae<br>
inet addr:10.0.0.7 Bcast:10.0.0.255 Mask:255.255.255.0<br>
inet6 addr: fe80::922b:34ff:fea9:c5ae/64 Scope:Link<br>
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:190131 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:142571 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:1000<br>
RX bytes:130422046 (130.4 MB) TX bytes:28887979 (28.8 MB)<br>
<br>
lo Link encap:Local Loopback<br>
inet addr:127.0.0.1 Mask:255.0.0.0<br>
inet6 addr: ::1/128 Scope:Host<br>
UP LOOPBACK RUNNING MTU:65536 Metric:1<br>
RX packets:13281 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:13281 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0<br>
RX bytes:1351192 (1.3 MB) TX bytes:1351192 (1.3 MB)<br>
<br>
$ route -n<br>
Kernel IP routing table<br>
Destination Gateway Genmask Flags Metric Ref Use Iface<br>
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 eth0<br>
10.0.0.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0<br>
<br>
<br>
I'm asking here as I don't want to get into a situation where I can no<br>
longer communicate with the machine while testing different<br>
configurations. Thanks.<br>
<br>
I took the basic config skeleton from the Ubuntu server guide Network<br>
Configuration page:<br>
<a href="https://help.ubuntu.com/14.04/serverguide/network-configuration.html" target="_blank">https://help.ubuntu.com/14.04/serverguide/network-configuration.html</a><br>
<br>
--<br>
Dotan Cohen<br>
<br>
<a href="http://gibberish.co.il" target="_blank">http://gibberish.co.il</a><br>
<a href="http://what-is-what.com" target="_blank">http://what-is-what.com</a><br>
<br>
--<br>
ubuntu-server mailing list<br>
<a href="mailto:ubuntu-server@lists.ubuntu.com">ubuntu-server@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-server" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-server</a><br>
More info: <a href="https://wiki.ubuntu.com/ServerTeam" target="_blank">https://wiki.ubuntu.com/ServerTeam</a><br>
</blockquote></div>