目标: 让一个网卡,支持多个IP
1. 修改配置文件(为了让重启之后仍然有用)
/etc/network/interfaces 文件内容如下:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.2.151
netmask 255.255.255.0
gateway 192.168.2.1
auto eth0:0 /*为了调试开发板,开发板IP是192.168.1.6,要向开发板传送bin文件*/
iface eth0:0 inet static
address 192.168.1.151
netmask 255.255.255.0
gateway 192.168.1.1
2. 重启网络服务
/etc/init.d/networking restart
3. 看运行是否正常
ping 192.168.1.150 /*我的Windows XP主机,嘿嘿*/
4. OK啦
本文介绍了在Ubuntu系统中如何让一个网卡支持多个IP地址,以实现多IP绑定。主要步骤包括修改配置文件`/etc/network/interfaces`,重启网络服务并验证设置是否成功。
1万+

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



