ubuntu ip设置
在Debian(ubuntu就是Debian類linux)中網卡的設置可以通過/etc/network/interfaces文件來進行,具體可分為三種不同的配置方式:DHCP自動獲取、靜態分配IP地址和PPPoE寬帶撥號。?
具體設置如下: 在進行配置之前,首先進入/etc/network目錄中,編輯interfaces文件:?
網卡通過DHCP自動獲取IP地址?
# This file describes the network interfaces available on your system?
# and how to activate them. For more information, see interfaces(5).?
#?
# The loopback network interface(配置環回口)?
# 開機自動激lo接口?
auto lo?
# 配置lo接口為環回口?
iface lo inet loopback?
#?
# The primary network interface (配置主網絡接口)?
#開機自動激活eth0接口?
auto eth0?
#配置eth0接口為DHCP自動獲取?
iface eth0 inet dhcp
網卡靜態分配IP地址?
# This file describes the network interfaces available on your system?
# and how to activate them. For more information, see interfaces(5).?
#?
# The loopback network interface(配置環回口)?
# 開機自動激lo接口?
auto lo?
# 配置lo接口為環回口?
iface lo inet loopback?
#?
# The primary network interface (配置主網絡接口)?
#開機自動激活eth0接口?
auto eth0?
#配置eth0接口為靜態設置IP地址?
iface eth0 inet static?
address 10.16.3.99?
netmask 255.255.255.0?
network 10.16.3.0?
broadcast 10.16.3.255?
gateway 10.16.3.1?
# dns-* options are implemented by the resolvconf package, if installed(DNS設置)?
dns-nameservers 61.153.177.196 61.153.177.197?
dns-search fireteam.org?
網卡進行PPPoE寬帶撥號配置?
# This file describes the network interfaces available on your system?
# and how to activate them. For more information, see interfaces(5).?
#?
# The loopback network interface(配置環回口)?
# 開機自動激lo接口?
auto lo?
# 配置lo接口為環回口?
iface lo inet loopback?
#?
# The primary network interface (配置主網絡接口)?
#開機自動激活eth0接口?
auto eth0?
#配置eth0接口為靜態設置IP地址?
iface eth0 inet static?
address 10.16.3.99?
netmask 255.255.255.0?
network 10.16.3.0?
broadcast 10.16.3.255?
配置完畢后,重啟計算機或網絡服務即可將網卡配好。重啟網絡服務命令為:
sudo /etc/init.d/networking restart
總結
以上是生活随笔為你收集整理的ubuntu ip设置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《漫威蜘蛛侠》开发商被群嘲:多次称游戏不
- 下一篇: ubuntu gedit出错:Faile