[Linux]配备网络

[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

[Linux]配备网络

相关文章:

你感兴趣的文章:

标签云: