直接修改系统配置文件
ubuntu的网络配置文件是:/etc/network/interfaces
ubuntu命令行修改网络配置方法前面auto  eth?,让网卡开机自动挂载.

为网卡配置静态IP地址

编辑文件/etc/network/interfaces:

sudo vi
/etc/network/interfaces

并用下面的行来替换有关eth0的行:# The primary network
interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 192.168.3.255

 

同时,在/etc/resolv.conf中配置dns  或在   /etc/resolvconf/resolv.conf.d/base 中配置dns

     添加: nameserver your_nds_ip

将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效:
sudo
/etc/init.d/networking restart

 

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2021-08-08
猜你喜欢
  • 2022-12-23
  • 2021-10-11
  • 2021-12-23
  • 2022-01-28
  • 2021-12-25
相关资源
相似解决方案