[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
編輯/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]配置网络的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [Linux]控制语句If case
- 下一篇: linux 其他常用命令