2

I'm running an Ubuntu server, I don't really like Ubuntu but its the only platform where Steam is supported by valve. So as of now I'm using Ubuntu for my game servers.

I have set a static ip address in /etc/network/interfaces but my card keeps recieving a DHCP address as well. So basically the server has my static ip 192.168.1.13 and a DHCP address 192.168.1.226.

How can I stop the dhcpclient?

It's a new 17.10 install without any major changes in the install.

1
  • auto ens18 iface ens18 inet static address 192.168.1.13 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 – Mighty_Pooh Mar 11 '18 at 17:55
2

Networking changed in Ubuntu 17.10 so adding anything to /etc/network/interfaces won't change anything. It now uses Netplan.

To disable DHCP and set a static IP:

First, find out what your network interface is called, run ls /sys/class/net

The output will probably be something like enp6s0 lo.

lo is the loopback interface so enp6s0 will be your network interface (in this example).

Create a new config file inside of /etc/netplan

e.g sudo nano /etc/netplan/02-netcfg.yaml

Enter the following to configure a static IP of 192.168.1.13 where enp6s0 is the name of your network interface.

network:
    version: 2
    renderer: networkd
    ethernets:
        enp6s0:
            addresses: [192.168.1.13/24]
            dhcp4: no
            gateway4: 192.168.1.1

Then run the following two commands:

sudo netplan generate
sudo netplan apply
1
  • Probably, you need add nameservers: addresses: [192.168.1.1] at the end of file – Yura Shinkarev Aug 3 '20 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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