0

I have a physical machine running ubuntu server 16.04, and I am having a bit of trouble interacting with it. When I run ifconfig I see it's public IP address, but when I try to ping it from another machine nothing happens.

What I have been able to do in order to interact with it, is on the server, login as some user, run sudo service networking restart and then I can interact with the machine remotely (ping for example). However, the second I run exit or logout on the server, I can no longer interact with it again.

It's also worth noting that I don't seem to be able to ping anything from the server until I restart the networking like I mentioned just above. Once I restart networking, I can ping out, but again once I log out and in again, I am back where I started.

How can I begin to have the networking setup such that it simply works on boot?

The contents of /etc/network/interfaces is:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp8s0
iface enp8s0 inet dhcp

UPDATE:

It would appear that even after restarting the networking service, I can still only intermittently ping it.

3 Answers3

1

I suggest the following /etc/network/interfaces file:

auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet static
address 192.168.254.120 
netmask 255.255.255.0
gateway 192.168.254.1
dns-nameservers 8.8.8.8 192.168.254.1

Be sure to select an address outside the range used for DHCP in the router. Of course, substitute your details here.

Now get the system to read and use the changes:

sudo ifdown enp8s0 && sudo ifup enp8s0

Check that you can reach the internet:

ping -c3 www.ubuntu.com
chili555
  • 61,330
0

Please use the method from the second answer to edit your interfaces file and set a static IP.

-1

You can try /etc/rc.local. To run a command at startup, use sudo nano /etc/rc.local and at the first availble line, type sudo networking restart. hope this helps

PMiner
  • 17