伺服器ip遷移紀要
21樓機房之前已配 25 網段靜態 ip ,機架上 14 臺伺服器接 22 樓機房交換機,同樣 25 網段。
實際有兩種情況,
a、 25 網段 ip 沒有被他人佔用,這種情況無需更改 ip 。
b、該 IP 已被外部使用, ip 衝突,無法通過原有 ip 利用 cockpit 修改
解決方案一:
1、檢視 cockpit 服務是否啟動,若啟動則停止 cockpit 服務
service cockpit stop
2、修改 /etc/network/interfaces 檔案,配置 dhcp 分配 ip
增加以下欄位
auto enp1s0(需注意實際網絡卡名稱)
iface enp1s0 inet dhcp
3、修改完畢,重啟網路服務
service networking restart
4、重啟 cockpit 服務
service cockpit start
4、檢查新的 ip 能否 ping 通 www.baidu.com 、區域網內其他 ip 。
5、第 4 步成功的話,即可通過訪問網頁訪問 ip:9090 進行靜態 ip 配置。若不成功再定位其他原因。
解決方案二:
1、解除安裝 cockpit 服務
2、配置 /etc/network/interfaces 檔案,分配一個動態 ip
3、通過 /etc/network/interfaces檔案 ,設定步驟 2中的動態 ip 為靜態 ip
增加以下欄位
auto enp1s0
iface enp1s0 inet static
address xxx
netmask xxx
dns-nameserver xxx
4、重啟網路服務即可