Open Terminal (opened with ctrl+alt+t) 1. Enter Ifconfig print as follows: Enp1s0 Link encap:ethernet HWaddr 6c:4b:90:0b:53:be
inet addr:192.168.1.101 bcast:192.168.1.255 mask:255.255.255.0
Inet6 ADDR:FE80::1FBF:55E3:1C4C:C79D/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:144897 errors:0 dropped:630 overruns:0 frame:0
TX packets:13548 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13441598 (13.4 MB) TX bytes:1943215 (1.9 MB)
Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Inet6 addr::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:65536 metric:1
RX packets:7441 errors:0 dropped:0 overruns:0 frame:0
TX packets:7441 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Txqueuelen:1
RX bytes:727906 (727.9 KB) TX bytes:727906 (727.9 KB)
Wlp2s0 Link encap:ethernet HWaddr 34:f6:4b:8e:8e:83
inet addr:192.168.17.208 bcast:192.168.17.255 mask:255.255.255.0
Inet6 ADDR:FE80::7B1:7FD6:CDBC:29A0/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:39311 errors:0 dropped:0 overruns:0 frame:0
TX packets:34360 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19874047 (19.8 MB) TX bytes:6833538 (6.8 MB)
2. Start setting up IP, gateway, etc.
sudo
vi
/etc/network/interfaces
#静态设置IP地址
auto lo
iface lo inet loopback
auto enp1s0
iface enp1s0 inet static
address 192.168.12.89(换成你的IP地址)
netmask 255.255.255.0
gateway 192.168.12.1(换成你的网关)
#自动获得IP地址
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
3. Restart the network card
sudo
/etc/init
.d
/networking
restart
Complete
Ubuntu setting IP Address, gateway method