Linux下網路配置檔案

2021-05-26 20:38:05 字數 592 閱讀 4535

/etc/hosts

這個檔案用於設定主機名與 ip 對映關係,為那些無法通過其它方式 (如通過 dns 伺服器) 解析的主機名進行解析,它還能夠在沒有 dns 的小型網路中充當主機名解析的角色。不論計算機在什麼型別的網路上,hosts 檔案中都有關於環迴鏈路(127.0.0.1)的主機記錄 (localhost.localdomain)。

/etc/resolv.conf

這個檔案用於設定 dns 的 ip 位址和搜尋域,除非另行配置,否則網路初始化指令碼總是使用這個文件中的配置資訊。

/etc/sysconfig/network

這個檔案用於為所有網路介面設定路由和主機資訊。

/etc/sysconfig/network-script/ifcfg-

每乙個網路介面,都有乙個與之對應用的配置指令碼,這些指令碼檔案為相應的網路介面設定指定的配置資訊。

/etc/sysconfig/networking/

目錄中包含著網路管理工具使用的文件,請不要人工更改這些檔案。

linux下網路引數的設定及配置檔案

文字模式下的 gedit etc sysconfig network scripts ifcfg inte ce name 配置檔案ifcfg inte ce name包含了初始化介面所需的大部分詳細資訊。其中inte ce name將根據網絡卡的型別和排序而不同,一般其名字為ifcfg eth0 ...

linux網路配置檔案

type ethernet bootproto static 設定靜態ip defroute yes ipv4 failure fatal no ipv6init yes ipv6 autoconf yes ipv6 defroute yes ipv6 failure fatal no name e...

Linux下網路配置總結

配置eth0的ip位址,同時啟用該裝置 ifconfig eth0 192.168.1.110 netmask 255.255.255.0 up 新增預設閘道器。route add default gw 192.168.1.1 設定dns,設定檔案 etc resolv.conf nameserve...