全球主机交流论坛

标题: 一个/24 如何绑定到服务器上 debian系统 有分 [打印本页]

作者: _____________Cc    时间: 2012-11-6 23:35
标题: 一个/24 如何绑定到服务器上 debian系统 有分
求帮忙
作者: Comcast    时间: 2012-11-6 23:36
多个IP吗。
作者: _____________Cc    时间: 2012-11-6 23:37
Comcast 发表于 2012-11-6 23:36
多个IP吗。

一个/24  段
作者: loveni    时间: 2012-11-6 23:39
技术帝都不会 我只能水了
作者: 落霞孤鹜    时间: 2012-11-6 23:52
ethN:M
作者: 安心    时间: 2012-11-6 23:52
DEVICE=eth0
BOOTPROTO=static
IPADDR_START=起始IP
IPADDR_END=结束IP
CLONENUM_START=0
NETMASK=255.255.255.0
ONBOOT=yes

这个么。
作者: Comcast    时间: 2012-11-6 23:52
_____________Cc 发表于 2012-11-6 23:37
一个/24  段

在/etc/sysconfig/network-scripts/中新建文件ifcfg-eth0-range0
1.cd /etc/sysconfig/network-scripts/
2.vi ifcfg-eth0-range0

输入以下文件内容格式:
1.IPADDR_START=起始IP
2.IPADDR_END=结尾IP
3.CLONENUM_START=0

最后service network restart
不知道对不对
作者: _____________Cc    时间: 2012-11-6 23:54
Comcast 发表于 2012-11-6 23:52
在/etc/sysconfig/network-scripts/中新建文件ifcfg-eth0-range0
1.cd /etc/sysconfig/network-scripts/
...
  1. /etc/sysconfig/network-scripts/
复制代码
debian没这个目录
作者: October十月    时间: 2012-11-6 23:59
_____________Cc 发表于 2012-11-6 23:54
debian没这个目录

/etc/network/interfaces
好像是这个
作者: renothing    时间: 2012-11-7 00:36
  1. for ip in {2..254};do ip addr add 1.2.3.$ip/24 dev eth0;done
复制代码

作者: 西崽猪猪    时间: 2012-11-7 00:46
renothing 发表于 2012-11-7 00:36
  1. for ip in {2..254};do ip addr add 1.2.3.$ip/24 dev eth0;done
复制代码


这个应该是正确的
作者: _____________Cc    时间: 2012-11-7 00:47
renothing 发表于 2012-11-7 00:36

比如 192.168.1.1/24 就是
  1. for ip in {2..254};do ip addr add 192.168.1.1/24 dev eth0;done
复制代码
ssh执行?
作者: renothing    时间: 2012-11-7 01:26
替换你的前三位即可。
作者: _____________Cc    时间: 2012-11-7 01:33
renothing 发表于 2012-11-7 01:26
替换你的前三位即可。
  1. RTNETLINK answers: File exists
  2. RTNETLINK answers: File exists
  3. RTNETLINK answers: File exists
  4. RTNETLINK answers: File exists
  5. RTNETLINK answers: File exists
  6. RTNETLINK answers: File exists
  7. RTNETLINK answers: File exists
  8. RTNETLINK answers: File exists
  9. RTNETLINK answers: File exists
  10. RTNETLINK answers: File exists
  11. RTNETLINK answers: File exists
  12. RTNETLINK answers: File exists
  13. RTNETLINK answers: File exists
复制代码
来了一堆提示
作者: 单手摘月    时间: 2012-11-7 06:59
提示: 作者被禁止或删除 内容自动屏蔽
作者: lazyzhu    时间: 2012-11-7 07:53
只是路过。。。
作者: 爱卡    时间: 2012-11-7 08:05
牛x
作者: _____________Cc    时间: 2012-11-7 14:14
单手摘月 发表于 2012-11-7 06:59
已經綁了吧?

没呢,等你帮忙
作者: renothing    时间: 2012-11-7 14:22
本帖最后由 renothing 于 2012-11-7 14:24 编辑

我写的那个已经很明白无误的了。。。
  1. for ip in {2..254};do ip addr add 192.168.1.$ip/24 dev eth0;done
复制代码
注意中间的变量

查看已绑定ip
  1. ip addr ls|awk '/br0[:0-9]*$|eth0[:0-9]*$|virbr0[:0-9]*$|venet[:0-9]*$/{print $2}'|cut -d'/' -f1
复制代码

作者: 404    时间: 2012-11-7 14:28
不明绝厉, 亲, 还是入我大centos党吧
作者: kaia    时间: 2012-11-7 14:36
终于出大手笔了




欢迎光临 全球主机交流论坛 (https://sunk.eu.org/) Powered by Discuz! X3.4