首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

[Linux]配备网络

2012-08-08 
[Linux]配置网络2.配置网络编辑/etc/network/interfaceauto eth0iface inet eth0 static #设置静态IP地址a

[Linux]配置网络
2.配置网络
编辑/etc/network/interface
auto eth0
iface inet eth0 static #设置静态IP地址
address 192.168.1.235
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
如果是要设置为自动获取ip地址就应该为
auto eth0
iface eth0 inet dhcp
保存,退出,重启网络
$/etc/init.d/networking restart
此时已经可以ping通局域网地址,但外网仍不行
Debian和Ubuntu一样,设置nameserver是在/etc/resolv.conf 里面,在其中添加一行:
nameserver 192.168.1.1

3.配置apt源
vim /etc/apt/source.list
然后进行更新源
apt-get -s upgrade
apt-get update

热点排行