ubuntu下设置静态ip

 

sudo vi /etc/networks/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 ens33
#iface ens33 inet dhcp   #设置为自动获得
iface ens33 inet static
address 192.168.1.20
gateway 192.168.1.1
netmask 255.255.255.0
~                       

 

posted @ 2017-09-07 16:11  学习时光  阅读(163)  评论(0)    收藏  举报