Setting Up a Static IP Address

  1. Find the logical name of the network device:

    $ sudo lshw -class network -short
    H/W path         Device           Class       Description
    /0/100/4/0       enp1s0           network     RTL810xE PCI Express Fast Ethernet controller
  2. Edit /etc/network/interfaces to contain the following (where the IP address of the router begins with 192.168.0.*):

    auto enp1s0
    iface enp1s0 inet static
Field Notes
address The static IP address to be set, here set to *.69
netmask 0 bits indicate bits that can be used for the IP address; here, only the lower 256 bits can be used
network First address in network, here set to *.0
broadcast Last address in network, here set to *.255
gateway IP address of the router
dns-nameservers NS servers; and are Google’s DNS servers
  1. Run sudo ifdown -v enp1s0 && sudo ifup -v enp1s0