全球主机交流论坛

标题: 搞定了 [打印本页]

作者: _____________Cc    时间: 2013-2-25 00:46
标题: 搞定了
本帖最后由 _____________Cc 于 2013-2-25 01:23 编辑

示例
  1. auto eth0:256
  2. iface eth0:256 inet static
  3. address 10.1.1.1
  4. netmask 255.255.240.0
  5. gateway 10.1.0.1

  6. ...

  7. auto eth0:509
  8. iface eth0:509 inet static
  9. address 10.1.1.254
  10. netmask 255.255.240.0
  11. gateway 10.1.0.1

  12. auto eth0:510
  13. iface eth0:510 inet static
  14. address 10.1.1.255
  15. netmask 255.255.240.0
  16. gateway 10.1.0.1
复制代码
给服务器加点了,求帮忙生成代码,手动写也太累了点。。

刚刚发了一帖莫名奇妙被删无任何提醒。蛋疼的

搞定了
  1. #! /bin/bash

  2. for ((han=256,an=1;han<511,an<256;han=han+1,an=an+1))
  3. do
  4. cat >>/root/test/text<<EOF

  5. auto eth0:$han
  6. iface eth0:$han inet static
  7. address 10.1.1.$an
  8. netmask 255.255.240.0
  9. gateway 10.1.0.1
  10. EOF
  11. done
复制代码

作者: 汉陈帝国    时间: 2013-2-25 00:49
被爆菊了
作者: Host.HowPick    时间: 2013-2-25 00:52
如果是标准的 VLan 分配, 可以到这里。

http://serveryou.com/tools/subnet-calculator
作者: 农民工    时间: 2013-2-25 00:54
不会啊亲
作者: Ruclinux    时间: 2013-2-25 02:52
我以为又把路由器刷砖了.
作者: ybs885    时间: 2013-2-25 08:45
额看不到




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