Categories
學習筆記

CentOS下单网卡自动绑定ip脚本bindip

bindip -a <IP Addr> <Default Gateway> <Subnet Mask>
bindip -d <IP Addr>
備註:-a為添加ip, -d為刪除ip

今天想了想 每次要綁定ip都要自己建立配置文件 說實話挺煩的
如果是1個ip 倒也無妨 但是有時候需要綁定好幾個ip 那就頭疼了
所以就幹脆寫了這個腳本 達到一鍵綁定ip和一鍵解除ip的目的

下載地址(右鍵另存):https://www.guyusoftware.com/sh/bindip
或直接

wget https://www.guyusoftware.com/sh/bindip;chmod 755 bindip;
./bindip -a <IP Addr> <Default Gateway> <Subnet Mask> 或
./bindip -d <IP Addr>

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.