Linux網路配置

2021-07-04 17:40:00 字數 890 閱讀 3795

本文介紹幾個常見linux系統的網路配置。

閘道器配置檔案為:/etc/sysconfig/network/routes

dns配置檔案為:/etc/resolv.conf

重啟網路命令為:service network restart

主機名(hostname)的配置檔案為:/etc/hostname,修改後執行命/etc/rc.d/boot.localnet start

ifcfg-eth0檔案格式如下:

bootproto='[static|hdcp]'

boradcast='192.168.1.255'

ethtool_options=''

ipaddr='192.168.1.23'

netmask='255.255.255.0'

gateway='192.168.1.254'

startmode='auto'

routes檔案格式如下:

default 192.168.1.254 eth0 -

resolv.conf檔案格式如下:

nameserver 192.168.1.1

hostname的格式如下:

直接寫主機名就可以,例如要設定為test,就直接寫test就可以。另外,重啟以後,可以生效。

主機名的配置檔案為:/etc/sysconfig/network

ifcfg-eth0的檔案格式如下:

device=eth0

type=ethernet

onboot=yes

bootproto="static"

ipaddr=192.168.1.1

gateway=192.168.1.1

network的檔案格式如下:

hostname=test

網路 linux網路配置

zlm ubuntu sudo ifconfig eth0 192.168.1.109 netmask 255.255.255.0 broadcast 192.168.1.255 zlm ubuntu sudo route add del default gw 192.168.1.1 新增刪除閘道器...

linux配置 網路配置

ip位址,子網掩碼,閘道器 設定ip位址,子網掩碼並啟用 ifconfig eth0 10.192.77.250 netmask 255.255.255.0 up 注 ip,掩碼,閘道器都設定到 etc sysconfig network scripts ifcfg eth0裡面了。設定多ip 可以...

linux網路管理 Linux網路配置

1.1 linux配置ip位址 1 ifconfig命令臨時配置ip位址 能不能自動獲取ip位址和dns位址,要看有沒有dhcp伺服器 win10上,輸入ipconfig all 會看到是否有dhcp伺服器 ifconfig命令 對此命令更加詳細的解說 傳送門 2 setup工具永久配置ip位址 r...