Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Network configuration under ubuntu

Shulou Source: shulou.com Published: 2022-06-03 06:48:37 11月15日 Update

Enter command 1: sudo vi /etc/network/interfaces

#DHCP gets ip configuration automatically

auto lo #boot auto lo interface

iface lo inet loopback #configure lo interface as loop loopback

auto eth0 #Start automatically activates eth0 interface

iface eth0 inet dhcp #configure eth0 interface for DHCP autofetch

#statically assign IP address configuration

auto lo #boot auto lo interface

iface lo inet loopback #configure lo interface as loop loopback

auto eth0 #Start automatically activates eth0 interface

iface eth0 inet static #Configure eth0 interface as static Set IP address

address 192.168.1.10

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1

#DNS Configuration

sudo vi /etc/resolv.conf

nameserver 192.168.1.1

Enter command 2: sudo /etc/init.d/networking restart #Restart the network

Tags: Interface configuration Command address Activation static input Network assignment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info vpn MariaDB MySQL