1. 程式人生 > >ubuntu下設定靜態ip

ubuntu下設定靜態ip

ubuntu下設定靜態ip

1.vim /etc/network/interfaces

2.設定動態ip

# 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

3.設定靜態ip

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.1