LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: redware

debian下一张网卡绑定多个IP的问题

[复制链接]
发表于 2005-11-8 10:38:29 | 显示全部楼层
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.10.31.4
        netmask 255.255.255.0
        network 10.10.31.0
        broadcast 10.10.31.255
        gateway 10.10.31.254

auto eth0:0
iface eth0:0 inet static
        address 10.10.31.5
        netmask 255.255.255.0
        network 10.10.31.0
        broadcast 10.10.31.255

注意,eth0:0没有gateway
然后使用ifup eth0:0就可以了。
不要使用/etc/init.d/network restart的方法

在debian中,启用和停止接口用ifup 和 ifdown的方法。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-10 00:18:36 | 显示全部楼层
在debian中“/etc/init.d/networking restart”也是通用的方法,我所有的服务都是在这里启动和停止的。这样就不会去记忆更多的命令了。
谢谢你找到了根源:就是在eth0:0中不要配置网关。
这样不管用哪种方法启动和停止服务都可以用了。
再次说声谢谢!
另外,Webmin配置的方法中,用“grep "eth0:0" * -R”找遍了也找不到哪里有“eth0:0”的配置,哪位能帮一下吗?
回复 支持 反对

使用道具 举报

发表于 2005-11-10 09:19:35 | 显示全部楼层
webmin只是一个辅助方法,更多的还是应该用系统本身的功能!
man interfaces仔细看看。
多看看man吧,很有帮助的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表