Ubuntu網路設定

2021-10-21 20:58:59 字數 1361 閱讀 7364

在使用ubuntu時經常會遇到網路設定問題,一般情況只需在桌面上進行設定即可。但有時也會遇到沒有桌面、無法使用桌面或不方便使用桌面的情況,這時就只能使用命令列來進行設定,本文介紹幾個用於設定ubuntu網路的命令。

ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
ifconfig eth0 192.168.1.3
ifconfig eth0 up
fconfig eth0 down
ifconfig eth0
ifconfig
可以使用route命令來配置並檢視核心路由表的配置情況。

route add –host 192.168.1.2 dev eth0:0

route add –host 10.20.30.148 gw 10.20.30.40

route add –net 10.20.30.40 netmask 255.255.255.248 eth0

route add –net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41

route add –net 192.168.1.0/24 eth1

route add default gw 192.168.1.1
route
route del –host 192.168.1.2 dev eth0:0

route del –host 10.20.30.148 gw 10.20.30.40

route del –net 10.20.30.40 netmask 255.255.255.248 eth0

route del –net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41

route del –net 192.168.1.0/24 eth1

route del default gw 192.168.1.1

可以使用netstat命令來顯示網路狀態資訊。

netstat –i
netstat –lpe
netstat –r

netstat –nr

netstat –t

netstat –u

ubuntu網路設定

主要檔案 etc network inte ces,這裡是ip 閘道器 掩碼等的一些配置 etc resolv.conf這個檔案儲存dns的有關資訊 主要命令 sudo etc init.d networking restart重啟網路,使配置檔案的配置生效 通過配置檔案配置 1 配置ip閘道器 s...

ubuntu網路設定

a,ubuntu系列網路配置資訊儲存在 etc network inte ces中 b,dns資訊儲存在 ect resolv.conf中.note 如果只是臨時性的改變ip位址,則不用修改inte ces檔案,只用ifconfig即可,不過當系統重啟後,系統會恢復inte ces中的配置.ifco...

ubuntu 設定網路

1.以dhcp方式配置網絡卡 編輯檔案 etc network inte ces sudo vi etc network inte ces 並用下面的行來替換有關eth0的行 the primary network inte ce use dhcp to find our address auto ...