Debian 下配置固定ip

2021-07-29 17:58:57 字數 1007 閱讀 2539

最近由於在虛擬機器裡準備自己開發乙個專案,由於linux系統本人涉略不深,只懂得一點基本的配置,所以要想直接在linux編寫**的話,不知道有什麼好用的類似於win下phpstorm之類的強大編輯器,所以想到samba共享到win下可以用自己熟悉的工具程式設計。

然而,每次開關虛擬機器的時候發現ip位址都會有變化,在win這邊samba就每次都需要手動配置一次,表示很麻煩,所以就想到了給虛擬機器配置乙個靜態ip,這樣在win這邊只要配置一次,以後就不用重複性的配置了。話不多說

2:到debian下,

a):給網路配置檔案做備份

cp  /etc/network/inte***ces  /etc/network/inte***ces

設定 eth0 網絡卡資訊 

vim   /etc/network/inte***ces

# the loopback network inte***ce

auto lo

auto eth0     #開機自動連線網路

iface lo inet loopback

allow-hotplug eth0

iface eth0 inet static     

#static表示使用固定ip,dhcp表述使用動態ip

address 192.168.0.211     

#設定ip位址

netmask 255.255.255.0     

#設定子網掩碼

gateway 192.168.0.1      #設定閘道器

注:寫進配置檔案中的時候需要把 # 的注釋資訊刪除掉,這裡只是做解釋用。

b):

# generated by networkmanager

nameserver 210.22.84.3      #設定首選dns

nameserver 210.22.70.3      #設定備用dns

c): 最後重啟網路

service networking restart #重啟網路

debian配置靜態ip

系統 debian 8.5 子網掩碼 255.255.255.0 閘道器 10.50.200.254 dns 219.147.1.66 8.8.8.8 操作 1 設定ip位址 閘道器 etc network inte ces etc network inte cesbak 備份原有配置檔案 etc ...

ubuntu下固定IP位址配置方法

靜態設定ipubuntu網路配置資訊儲存在 etc network inte ces 檔案中,預設內容如下 auto eth0 iface eth0 inet dhcpauto lo iface lo inet loopback 設定靜態ip的方法如下 使用root使用者編輯 etc network...

debian7系統設定固定IP

linux下檢視閘道器方法 1 route n 2 ip route show 3 traceroute www.prudentwoo.com s 100 第一行就是自己的閘道器 4 netstat r 5 more etc network inte ces debian ubuntu linux ...