欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linux /etc/network/interfaces配置接口方法

 更新時間:2020年02月11日 14:21:52   作者:yanceylu  
在本篇文章里小編給各位分享的是一篇關(guān)于Linux /etc/network/interfaces配置接口方法知識點,需要的朋友們可以學(xué)習(xí)下。

Linux下/etc/network/interfaces文件用來配置網(wǎng)絡(luò)接口。

初始化網(wǎng)口Ethernet Interface

大部分的網(wǎng)絡(luò)接口配置都可以在/etc/network/interfaces中解決。例如為網(wǎng)卡配置靜態(tài)IP(dhcp),設(shè)置路由信息,配置IP掩碼,設(shè)置默認路由等。

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不解析名字。

以上就是腳本之家小編給大家整理的相關(guān)內(nèi)容,感謝大家的學(xué)習(xí)和支持。

相關(guān)文章

最新評論