Ubuntu 16.04 LTS : cau hinh network

[1] Change to static IP addres if you use Ubuntu as a server. "ens3" is different on each environment, replace it to your own one.
root@dlp:~# vi /etc/network/interfaces
# 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 ens3
# comment out
#iface ens3 inet dhcp
# add these lines
iface ens3 inet static
address 10.0.0.30# IP address
network 10.0.0.0# network address
netmask 255.255.255.0# subnet mask
broadcast 10.0.0.255# broadcast address
gateway 10.0.0.1# default gateway
dns-nameservers 10.0.0.10# name server
# reboot once
root@dlp:~# reboot 

[2] Disable IPv6 if not needed.

root@dlp:~# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf 
root@dlp:~# sysctl -p
root@dlp:~# ip addr 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:ad:7d:9c brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.30/24 brd 10.0.0.255 scope global ens3
       valid_lft forever preferred_lft forever
  • 0 Người dùng thấy hướng dẫn này hữu ích
Hướng dẫn này có hữu ích?

Những hướng dẫn liên quan

Ubuntu 16.04 LTS : cai dat

[1] Insert a disk for installation of Ubuntu 16.04 and reboot your computer. Next, Choose...

Ubuntu 16.04 LTS : tao user

[1]If you'd like to add new user, Add like follows. # add a new user "ubuntu" xerus@dlp:~$ sudo...

Ubuntu 16.04 LTS : su dung Sudo

Configure Sudo to separate users' duty if some people share privileges. [1] Install Sudo....

Ubuntu 16.04 LTS : kich hoat tai khoan root

The root Account in Ubuntu is disabled by default because his password is not set. But if you'd...

Ubuntu 16.04 LTS : cac cau hinh cua lenh Vim

Configure Vim that is more convenience than vi. [1] Configure Vim. ( Apply to a user below. If...