问题描述:
解决Ubuntu10.04中网络配置
注意:其他Linux发行版中的系统网络配置文件可能会不一样
问题解决:
在Ubuntu中进行网络配置需要的主要文件有:
(1)/etc/network/interfaces
这个文件中可以进行IP/掩码/默认网关的配置
(2)/etc/resolv.conf
这个文件包含DNS域名解析的服务器地址
(3)/etc/init.d/networking
这个文件可以重新启动网卡的配置
/etc/init.d/networking restart
具体使用到的命令主要有如下命令:
(1)ifconfig -------查看网卡信息
(2)ifconfig eth0 up/down 启动/关闭网卡 eth0
(2.1)ifconfig eth0 down -----关闭eth0
注意:
以上cw命令式gnome-screenshot -w 的别名 alians cw='gnome-screenshot -w'
(2.2) ifconfig eth0 up ------启动eth0
(3)ifconfig eth0 125.0.0.0 netmask 255.0.0.0 -----配置网卡IP地址
(4)route add default gw 192.168.1.1 -------配置默认路由
(5)/etc/init.d/networking restart 重启网络配置