ubuntu16.04配置静态IP
时间: 2023-10-06 10:07:33 浏览: 70
为Ubuntu 16.04配置静态IP可以按照以下步骤进行操作:
1. 打开Terminal,输入以下命令:
sudo nano /etc/network/interfaces
2. 在打开的文件中,找到以下行:
iface eth0 inet dhcp
将其修改为以下行:
iface eth0 inet static
address your-ip-address
netmask your-subnet-mask
gateway your-gateway-address
注:以上三行中的“your-ip-address”、“your-subnet-mask”和“your-gateway-address”需要替换为实际的IP地址、子网掩码和网关地址。
3. 按下Ctrl+X键,输入Y键保存修改,退出nano。
4. 重新启动网络服务:
sudo service networking restart
5. 确认IP地址已经修改成功:
ifconfig
可以看到类似如下的信息:
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:your-ip-address Mask:your-subnet-mask
inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:xxxxxx errors:0 dropped:0 overruns:0 frame:0
TX packets:xxxxxx errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:xxxxxx (xx GB) TX bytes:xxxxxx (xx GB)
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)