debian修改eth0ip
『壹』 linux debian緋葷粺鍙岀綉鍗″唴澶栫綉閰嶇疆闂棰 100
璁劇疆璺鐢卞嵆鍙錛屽熀鏈鎬濊礬灝辨槸錛
1銆佹墍鏈塱p鍖呴粯璁ら氳繃192.168.1.1榪涜岃漿鍙戱紝
route add default 鎼滅儲gw 192.168.1.1
2銆佸瑰唴緗戣劇疆杞鍙戠壒渚嬶紝閫氳繃鎸囧畾緗戝崱杞鍙戱紝
route add -net 172.18.0.0 netmask 255.255.0.0 dev eth0
涓婇潰鍛戒護鐨勭綉孌靛拰璁懼囧悕縐幫紝鏍規嵁鍏蜂綋鎯呭喌璋冩暣銆傛繁鍏ヤ簡瑙linux寤鴻瀛︿範銆妉inux灝辮ヨ繖涔堝︺嬭繖鏈涔
『貳』 Debian 雙網卡配置
Debian可通過以下步嫌升驟配置網卡:扒者改
1、將當前目錄切換到網卡配置文件所在的目錄,網卡配置文件所在的目錄為「/etc/network/」。使用「cd /etc/network」命令切換到網卡配置文件所在目錄;
2、使用nano編輯器或者vim編輯器,編輯網卡配置文件(interfaces),在當前目錄下執行命令"nano interfaces"即可編輯網卡配置文件的內容;
3、使用「Ctrl + O」組合鍵保存網卡配置文件內容,使用「Ctrl + X」組合鍵退出nano編輯器。使用「cat interfaces」命春判令查看已修改的網卡配置文件的內容;
4、使用「/etc/init.d/networking restart」命令使用網卡配置文件內容生效,並使用「ifconfig」命令查看網卡eth0網卡的ip地址;
5、使用nano保存、退出組合鍵保存文件內容。使用網卡重啟命令重啟即可獲取到IP地址。
# This file describes the network interfaces availableon your system
# and how to activate them. For more information, see interfaces(5).
#/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.116
netmask 255.255.255.0
gateway 192.168.1.2
auto eth0:1
iface eth0:1 inet static
address 192.168.1.135
netmask 255.255.255.0
gateway 192.168.1.2
1命令
uname -r //查看內核
lsb_release -a //所有版本信息
cat /etc/debian_version //查看deb