关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

linux云服务器如何更换ip

发布时间:2021/6/26 10:35:32
香港云服务器

linux中更换ip的方法:

  1. 打开linux终端;

  2. 2.输入“sudo vi /etc/network/interfaces”命令打开网络配置文件;

  3. 3、根据需求修改设置address、gateway、netmask这三个值;

  4. 4.最后输入“sudo /etc/init.d/networking restart”命令使网络设置生效即可更换ip。


image.png

具体操作步骤:

1、在linux系统桌面中使用快捷键【Ctrl+Alt+T】打开linux终端命令行模式。

2、在linux终端命令行中输入以下命令打开网络配置文件。

sudo vi /etc/network/interfaces

3.根据自己的需求修改设置address、gateway、netmask这三个值即可。

# The primary network interface iface eth0 inet staticauto eth0iface eth0 inet staticaddress 192.168.2.1 #ip地址gateway 192.168.2.254 #网关netmask 255.255.255.0 #子网掩码

4.最后输入以下命令使网络设置生效即可更换ip。

sudo /etc/init.d/networking restart