输入ifconfig查看本地ipv4地址,发现并没有设置,无法通过以太网与其他主机通信。下面来配置系统的以太网地址。
1、编辑文件/etc/network/interfaces:
sudo gedit /etc/network/interfaces
2、用下面的内容来替换有关eth0的行,并且将ip地址等信息换成自己就可以了:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.88
gateway 192.168.2.1
netmask 255.255.255.0
3、用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
4、再次查看网络地址,发现成功修改。