Debian系统使用/etc/network/interfaces文件来配置网卡,通过修改这个文件可以实现IP地址的绑定,此文章主要介绍Debian系统绑定ipv4地址。
首先通过ssh登录系统(root权限):
sudo nano /etc/network/interfaces
写入以下配置:
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
其中含义:
auto eth0 自动激活网卡,其中eth0代表网络接口名称。
iface eth0 inet static 表示静态IP配置。
address 要分配的静态IP地址。
netmask 子网掩码。
gateway 默认网关。
保存后重启网络:
sudo /etc/init.d/networking restart
或
sudo service networking restart
Copyright © 2013-2024 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号 粤公网安备 44200002445359号
增值电信业务经营许可证编号:B1-20222012
代理域名注册服务机构:西部数码