新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Linux/etc/network/interfaces配置接口方法
linux下/etc/network/interfaces文件用來配置網(wǎng)絡接口。

初始化網(wǎng)口Ethernet Interface
大部分的網(wǎng)絡接口配置都可以在/etc/network/interfaces中解決。例如為網(wǎng)卡配置靜態(tài)IP(dhcp),設置路由信息,配置IP掩碼,設置默認路由等。
PS: 如果想要在系統(tǒng)啟動時就自動啟動網(wǎng)口,需要添加auto一行,詳見下面示例。
1. 使用動態(tài)IP地址
auto eth0 iface eth0 inet dhcp
2. 使用靜態(tài)IP地址
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 # network 192.168.1.0 # broadcast 192.168.1.255
network和broadcast一般使用默認值就行。
3. 查看路由表
# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
route -n不解析名字。
本篇文章到此結(jié)束,如果您有相關技術方面疑問可以聯(lián)系我們技術人員遠程解決,感謝大家支持本站!
創(chuàng)新互聯(lián)-老牌IDC、云計算及IT信息化服務領域的服務供應商,業(yè)務涵蓋IDC(互聯(lián)網(wǎng)數(shù)據(jù)中心)服務、云計算服務、IT信息化、AI算力租賃平臺(智算云),軟件開發(fā),網(wǎng)站建設,咨詢熱線:028-86922220
本文題目:Linux/etc/network/interfaces配置接口方法
URL網(wǎng)址:http://m.fisionsoft.com.cn/article/cciidjp.html


咨詢
建站咨詢
