宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 1477|回复: 5

搞定了

[复制链接]
发表于 2013-2-25 00:46:52 | 显示全部楼层 |阅读模式
本帖最后由 _____________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:51 | 显示全部楼层
被爆菊了
发表于 2013-2-25 00:52:36 | 显示全部楼层
如果是标准的 VLan 分配, 可以到这里。

http://serveryou.com/tools/subnet-calculator
发表于 2013-2-25 00:54:10 | 显示全部楼层
不会啊亲
发表于 2013-2-25 02:52:33 | 显示全部楼层
我以为又把路由器刷砖了.
发表于 2013-2-25 08:45:21 | 显示全部楼层
额看不到
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|FastFib VPS论坛

GMT+8, 2024-9-21 01:53 , Processed in 0.063994 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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