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