Debian 8 5設定靜態IP

2021-07-17 01:42:12 字數 1075 閱讀 8048

為什麼要設定靜態ip?

因為我在做分布式的時候發現每台啟動的ip不容易固定,每次都要去修改,所以......

因為這個網段不止我乙個人用......

因為木有錢再去買個路由器給自己分配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/network/inte***ces   #編輯網網絡卡配置檔案

auto eth0  #開機自動連線網路

iface lo inet loopback

allow-hotplug eth0

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

address 10.50.200.48   #設定ip位址

netmask 255.255.255.0  #設定子網掩碼

gateway 10.50.200.254

#設定閘道器

2、設定dns

cp  /etc/resolv.conf   /etc/resolv.confbak    #備份原有dns配置檔案

$/etc/resolv.conf   #編輯配置檔案

nameserver 219.147.1.66   #設定首選dns

nameserver8.8.8.8   #設定備用dns

3、重啟網路

$ service networking restart   #重啟網路,不行加上 sudo 

至此,ip位址、閘道器、dns配置完成,現在系統已經可以上網了。

設定debian的靜態IP

例如想要設定網路的資訊如下 子網掩碼 255.255.255.0 閘道器 10.10.10.2 dns 10.10.10.2,114.114.114.114 我們需要編輯2個檔案 etc network inte ces 配置ip和閘道器 etc resolv.conf 配置dns伺服器 先vi e...

Debian 8 5配置mips 32位編譯環境

1.首先新增toolchain環境變數 每乙個開發平台所需要用到的交叉編譯鏈結工具不一樣,新增到系統 etc profile即可 su進入root,執行 vi etc profile 在最後新增 export path path usr bin 新增完成後執行 source etc profile ...

689 設定debian的靜態IP

ipconfig all可檢視一下資訊 想要設定網路的資訊如下 我們需要編輯2個檔案 etc network inte ces 配置ip和閘道器 etc resolv.conf 配置dns伺服器 檢視可用網絡卡 root debian ip addr 1 lo mtu 65536 qdisc noq...