修改Ubuntu 靜態ip

2021-06-18 01:17:49 字數 567 閱讀 8831

1、切換root身份:su root

#加入 修改為靜態ip 

iface eth0 inet static

#要修改的ip

address 192.168.1.201

#修改閘道器

gateway 192.168.1.1

#修改子網掩碼

netmask 255.255.255.0

4、儲存退出.

5、重啟網路生效:sudo /etc/init.d/networking restart

************************上面的僅僅在區域網內能用,要鏈結internet還要設定dns伺服器************************

1、修改 resolvconf服務的配置檔案: /etc/resolvconf/resolv.conf.d/base :vim /etc/resolvconf/resolv.conf.d/base

2、加入:nameserver 【ip1】 換行 nameserver 【ip2】

3、重啟網路生效:sudo /etc/init.d/networking restart

ubuntu 修改靜態ip

1.檢驗是否可以連通,就使用ping命令ping 閘道器 2.設定ip sudo ifconfig eth0 10.8.17.99 netmask 255.255.255.0 這樣就算設定好了網絡卡eth0的ip位址和子網掩碼 3.設定閘道器 sudo route add default gw 13...

ubuntu修改配置靜態ip

ubuntu配置和修改ip位址 1 修改配置檔案 etc network inte ces root ubuntu sudo gedit etc network inte ces 新增以下內容 auto eth0 設定自動啟動eth0介面 iface eth0 inet static 配置靜態ip ...

Ubuntu18 04修改靜態IP

虛擬網路編輯器填所要固定的ip,子網掩碼,閘道器等 配置檔案 vi etc network inte ces,加入 auto ens33 iface ens33 inet static address 192.168.75.1 netmask 255.255.255.0 gateway 192.16...