|
|
本帖最后由 _____________Cc 于 2013-2-25 01:23 编辑
示例- auto eth0:256
- iface eth0:256 inet static
- address 10.1.1.1
- netmask 255.255.240.0
- gateway 10.1.0.1
- ...
- auto eth0:509
- iface eth0:509 inet static
- address 10.1.1.254
- netmask 255.255.240.0
- gateway 10.1.0.1
- auto eth0:510
- iface eth0:510 inet static
- address 10.1.1.255
- netmask 255.255.240.0
- gateway 10.1.0.1
复制代码 给服务器加点了,求帮忙生成代码,手动写也太累了点。。
刚刚发了一帖莫名奇妙被删无任何提醒。蛋疼的
搞定了- #! /bin/bash
- for ((han=256,an=1;han<511,an<256;han=han+1,an=an+1))
- do
- cat >>/root/test/text<<EOF
- auto eth0:$han
- iface eth0:$han inet static
- address 10.1.1.$an
- netmask 255.255.240.0
- gateway 10.1.0.1
- EOF
- done
复制代码 |
|