记录、分享
一直在路上

ubuntu批量添加IP脚本

创建如下的sh脚本,运行即可:

# !/bin/bash

for ((i=0;i<=3;i=i+1))

do

echo "auto eth0:$i">>/etc/network/interfaces

echo "iface eth0:$i inet static">>/etc/network/interfaces

let j=$i+179

echo "address 45.41.89.$j">>/etc/network/interfaces

echo "netmask 255.255.255.248">>/etc/network/interfaces

echo "gateway 45.41.89.177">>/etc/network/interfaces

echo " ">>/etc/network/interfaces

done

# end

 

 

 

 

 

转自:http://9283898.blog.51cto.com/9273898/1688876

打赏
欢迎转载,请注明出处:轻时代 » ubuntu批量添加IP脚本

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址