ubuntu Server 設定主機靜態 ip位址

2021-09-06 15:47:13 字數 657 閱讀 9715

ubuntu server 設定主機靜態 ip位址

1:先輸入 ifconfig 檢視當前網路配置

2:然後關閉 eth0 網絡卡

sudo ifdown eth0

3:配置靜態ip

sudo vim /etc/network/inte***ces

開啟檔案,修改eth0的配置,設定您的ip,閘道器,子網掩碼

4:此時,如果不配置dns ,ping不通的;

sudo vim /etc/resolv.conf 

新增nameserver 即可

5:儲存退出

6:啟用網絡卡eth0

sudo ifup eth0

7: 測試 一下網路連線情況

ifconfig

ping -c 3 t.cn

看結果正常,即表示靜態位址配置已生效

參考:

ubuntu server 時區設定

linux預設情況下使用utc格式作為標準時間格式,如果在linux下執行程式,且在程式中指定了與系統不一樣的時區的時候,可能會造成時間錯誤。在ubuntu 中給出了 tzconfig 和 tzselect 工具來設定時區。在 server edition 中我們可以使用tzselect來設定時區。...

ubuntu server 設定靜態ip

修改這個網路配置檔案,預設一般是自動獲得ip的。sudo vi etc network inte ces 檔案內容 auto lo iface lo inet loopback script grep map eth0 auto eth0 iface eth0 inet static address...

Ubuntu server 設定靜態IP

需求 在virtualbox裡裝了ubuntu server 14的映象做本地伺服器,對外提供ssh訪問,在內網訪問時需要使用ip,但是預設的ip都是dhcp模式自動獲取的,每次重啟虛擬機器,ip都會變化,如何設定為靜態ip?the primary network inte ce auto eth0...