Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Ubuntu 設定靜態 IP 完整步驟

編輯:Linux 教學

修改網路設定檔

編輯 /etc/network/interfaces:

sudo vi /etc/network/interfaces

預設僅有 loopback:

auto lo
iface lo inet loopback

新增乙太網卡 eth0 靜態 IP 設定:

auto eth0
iface eth0 inet static
address 172.22.112.13
netmask 255.255.255.128
gateway 172.22.112.1
  • auto eth0:開機自動啟用
  • inet static:IPv4 靜態 IP(inet6 為 IPv6)

設定 DNS

編輯 /etc/resolv.conf(不存在則新建):

sudo vi /etc/resolv.conf
nameserver 202.202.32.33
nameserver 61.128.128.68

重啟網卡生效

sudo ifdown eth0
sudo ifup eth0
Copyright © Windows教程網 All Rights Reserved