Deepin 設置靜態 ip


Deepin 設置靜態 ip

1 獲取 網卡的名稱

  • 打開終端輸入
yang@yang:~$ ifconfig -a
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.217.82  netmask 255.255.255.0  broadcast 192.168.217.255
        inet6 fe80::2e4d:54ff:fe9b:2dc4  prefixlen 64  scopeid 0x20<link>
        ether 2c:4d:54:9b:2d:c4  txqueuelen 1000  (Ethernet)
        RX packets 2774  bytes 283691 (277.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 480  bytes 67196 (65.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 826  bytes 67458 (65.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 826  bytes 67458 (65.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • enp3s0 網卡名稱

2 添加 IP 地址

  • 在 /etc/network/interfaces 中添加內容
# 靜態ip
auto enp3s0
# enp3s0 是網卡名稱
iface enp3s0 inet static
# 設置 DHCP 為動態
address 192.168.217.82
# 要設置的靜態 IP 地址
netmask 255.255.255.0
# 子網掩碼
gateway 192.168.217.1
# 網關
dns-nameserver 119.29.29.29
# dns 地址

3 重啟網絡

sudo /etc/init.d/networking restart

4 如果出現 出現域名解析暫時失敗

  • 打開 /etc/resolv.conf , 添加 nameserver 119.29.29.29
sudo vim /etc/resolv.conf

# 編輯文件
#i Generated by NetworkManager
nameserver 119.29.29.29
# 添加一行
  • 重啟網絡
sudo /etc/init.d/networking restart

4 參考

簡書
csdn


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM