教你在Linux中如何配置网络地址

查看网络接口信息

ifconfig						//用于查看网络接口信息
/sbin/ifconfig					//查看所有活动网络接口信息
/sbin/ifconfig -a				///查看所有网络接口(包括非活动网络接口)的信息
/sbin/ifconfig etho				//查看指定网络接口信息

网络配置

进去目录/etc/network/目录

用vi编辑器打开interface文件

auto eth0
interface eth0 inet static			//采取静态IP地址
address xxxxxx						//静态IP地址
network xxxxxx						//子网掩码
gateway xxxxxxx						//网关

重启服务

/etc/init.d/networking restart
原文地址:https://www.cnblogs.com/ghbuff/p/12773881.html