# PVE 實體機器固定 IP 與浮動 IP 互換教學 --- ## 進到 PVE 網路設置文件 進到 network interface 描述文件 ```shell nano /etc/network/interface ``` ---- ### 固定 IP 配置文件 ```text auto lo iface io inet loopback iface enp3s0 inet manual auto vmbr iface vmbr0 inet static address XXX.XX.XX.XX/24 gateway XXX.XX.XX.254 bridge-ports enp3s0 bridge-stp off bridge-fd 0 iface wlo1 inet manual source /etc/network/infaces.d/* ``` - iface 網路接口標籤 - inet 網路協議 - 設備 - vmbr 虛擬網橋 - enp 乙太網路接口 - wlo 無線網路接口 ---- ### 浮動 IP 配置文件 ```text auto lo iface io inet loopback iface enp3s0 inet manual auto vmbr iface vmbr0 inet dhcp bridge-ports enp3s0 bridge-stp off bridge-fd 0 iface wlo1 inet dhcp source /etc/network/infaces.d/* ``` ## 透過系統工具套用設定(重新向 DHCP 取得 IP或重啟網卡也適用) 基本上就是重啟服務的概念 ```shell systemctl stop networking # 停用網路服務 ip link set enp3s0 down # 關閉乙太網卡 ip link set enp3s0 up # 開啟乙太網卡 systemctl start networking # 開啟網路服務 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up