您好,登錄后才能下訂單哦!
ubuntu 批量添加ip腳本
# !/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
上為一個腳本程序(ip較多的時候)
下為ip數量較少
auto eth0:1
iface eth0:1 inet static
address 104.237.51.90
netmask 255.255.255.248
gateway 104.237.51.89
auto eth0:2
iface eth0:2 inet static
address 104.237.51.91
netmask 255.255.255.248
gateway 104.237.51.89
auto eth0:3
iface eth0:3 inet static
address 104.237.51.92
netmask 255.255.255.248
gateway 104.237.51.89
auto eth0:4
iface eth0:4 inet static
address 104.237.51.93
netmask 255.255.255.248
gateway 104.237.51.89
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。