有鑑於這兩個禮拜放在實驗室的Linux機器一直飽受被搶IP之苦,再加上
Linux 天生"文弱"?! 搶IP總搶不過罷道的 Windows...
(PS. 實驗室的IP屬自由使用,並沒有和MAC互相鎖定...)
所以,得想個方法解決一下:
------------------------用crontab 每一分鐘執行一次------------
#!/bin/bash
ping -c 3 168.95.192.1 > /dev/null
if [ $? -ne 0 ]; then
echo "reconfiguring ethernet connection"
ifdown eth0
ifup eth0
fi
---------------------------------------------------------------
ping -c 3 168.95.192.1 > /dev/null
if [ $? -ne 0 ]; then
echo "reconfiguring ethernet connection"
ifdown eth0
ifup eth0
fi
---------------------------------------------------------------
沒有留言:
張貼留言