After updating an old 'sandbox' type 14.04 desktop computer to 16.04 server to use again for mostly the same purpose, I was attempting to give the computer a static IP, and eventually forward a port to/for it, but I ran into trouble when editing the /etc/network/interfaces file to reflect the new static IP.
The file originally read:
auto lo
iface lo inet loopback
in it's entirety, save for the comments. There were no references to the other two network devices that ifconfig showed...
enp0s7 Link encap:Ethernet HWaddr 00:19:21:f5:04:42
inet addr:192.168.1.116 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::4672:94c8:d31b:a04a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2694 errors:0 dropped:0 overruns:0 frame:0
TX packets:1765 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2345098 (2.3 MB) TX bytes:166817 (166.8 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:65536 Metric:1
RX packets:385 errors:0 dropped:0 overruns:0 frame:0
TX packets:385 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:37291 (37.2 KB) TX bytes:37291 (37.2 KB)
virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Anyone know why that is?
And besides that, when I changed the /etc/network/interfaces file to read:
auto lo
iface lo inet loopback
auto enp0s7
iface enp0s7 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameserver 8.8.8.8 8.8.4.4
and used service networking restart, I lost internet connection, and the 'Wired' connection in the network tab of settings, i.e. the network connection symbol showing I was connected via wired connect, disappeared in both places. Upon restarting the system, the problem was still there, and the only way I've been able to regain internet connect/wired connection was to get rid of all of the enp0s7 items in /etc/network/interfaces.
Does anyone know what's going on? Even after looking up tutorials, as well as the official Ubuntu docs on setting a static IP, this is the way it all says to do this, and it isn't working. My biggest suspicion lies in the fact that the adapter wasn't already present in the /etc/network/interfaces file, and that I had to add it, but I don't know what that means.
Help?
network-manager: see Why can't I set a static IP address for my Linux box? – steeldriver Jul 10 '16 at 16:45/etc/network/interfaces. – Alcuin Arundel Jul 10 '16 at 17:23/etc/network/interfacesand uninstall/stop network-manager? Or is network-manager hand-in-hand with GNOME? – Trevor Sears Jul 10 '16 at 17:26Thanks all!
– Trevor Sears Jul 10 '16 at 17:32