auto lo iface lo inet lookup
1.如果要使用DHCP动态获取则为:
sudo vi /etc/network/interfaces : auto eth0 iface eth0 inet dhcp
保存,退出VI;
2.如果要使用静态IP,则设置:
sudo vi /etc/network/interfaces : auto eth0 # iface eth0 inet dhcp iface eht0 inet static
address 192.168.1.254 netmask 255.255.255.0 gateway 192.168.1.1 nameserver 192.168.1.1
保存,退出VI
使用sudo /etc/init.d/networking restart 或sudo ifdown eth0关闭网络,sudo ifup eth0打开网络,重启网卡。
Ubuntu网络配置教程
本文详细介绍如何在Ubuntu系统中配置网络连接。包括通过DHCP动态获取IP地址的方法以及手动设置静态IP地址的过程。提供了具体的命令行操作步骤,如使用sudo编辑网络接口文件、重启网络服务等。
4099

被折叠的 条评论
为什么被折叠?



