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

Linux 網卡設定指令與靜態 IP 設定教學 (Debian/Ubuntu 風格)

編輯:Linux 教學
 

常用網路指令

  • ifconfig -a / ip addr show:查看所有介面資訊。
  • ifconfig eth0 down / ip link set eth0 down:關閉介面。
  • ifconfig eth0 up / ip link set eth0 up:啟用介面。
  • dhclient eth0:讓介面透過 DHCP 取得 IP。

設定靜態 IP (編輯 /etc/network/interfaces)

auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 114.114.114.114

若在 VMware NAT 模式下,請對應 VMnet8 子網段設定 (如 192.168.199.0/24)。

套用設定

/etc/init.d/networking restart
# 或 systemd 系統
systemctl restart networking
Copyright © Windows教程網 All Rights Reserved