1.ipv4
2進製32位—–10進製
172.25.0.10/255.255.255.0
172.25.0.10:ip位址
255.255.255.0:子網掩碼
子網掩碼255位對應的ip位為網路位
子網掩碼0對應的ip位為主機位
《圖形化》
1.圖形介面
2.文字化圖形
nmtui
《命令》
ifconfig 網絡卡 ip netmask ##臨時設定
《檔案》
dhcp##動態獲取
vim /etc/sysconfig/network-scripts/ifcfg-eth0
device=eth0##介面使用裝置
bootproto=dhcp##網絡卡工作模式
onboot=yes##網路服務開啟時自動啟用
name=eth0##網路介面名稱
此處在真機中執行命令vim /etc/sysconfig/network-scripts/ifcfg-br0
static|none ##靜態網路
vim /etc/sysconfig/network-scripts/ifcfg-eth0
device=eth0 ##裝置
bootproto=static|none ##裝置工作方式
onboot=yes ##開啟網路服務啟用裝置
name=eth0 ##網路介面名稱
ipaddr=172.25.0.100 ##ip
netmask=255.255.255.0 | prefix=24 ##子網掩碼
3.gateway 閘道器
1.路由器
主要功能是用來作nat的
dnat 目的地位址轉換
snat 源位址轉換
2.閘道器
路由器上和自己處在同乙個網段的那個ip
3.設定閘道器
systemctl stop netwrokmanager
vim /etc/sysconfig/network ##全域性閘道器
gateway=閘道器ip
vim /etc/sysconfig/network-scripts/ifcfg-網絡卡配置檔案 ##網絡卡介面閘道器
gateway=閘道器ip
route -n ##查詢閘道器
kernel ip routing table
destination gateway genmask flags metric ref use iface
0.0.0.0 (閘道器)172.25.0.254 0.0.0.0 ug 0 0 0 eth0
dns是一台伺服器
這太伺服器提供了回答客戶主機名和ip對應關係的功能
2.設定dns
vim /etc/resolv.conf
nameserver dns伺服器ip
vim /etc/sysconfig/network-scripts/ifcfg-網絡卡配置檔案
dns1=dns伺服器ip
3.本地解vim /etc/hosts主機名稱
4.本地解析檔案和dns讀取的優先順序調整
/etc/nsswitch.conf
38 #hosts: db files nisplus nis dns
39 hosts: files dns ##files代表本地解析檔案,dns代表dns伺服器,那個在前面那個優先
linux中網路配置二
一 設定dns 位址解析 系統操作者對字元敏感 系統網路通訊需要通過ip位址這個數字 這樣的過程叫做位址解析 dns伺服器 domain name server 網域名稱解析服務 解析就是把網域名稱變成ip vim etc resolv.conf dns的指向檔案 不需要重新啟動網路立即生效 nam...
Linux kernel中網路裝置的管理
kernel中使用net device結構來描述網路裝置,這個結構是網路驅動及介面層中最重要的結構。該結構不僅描述了介面方面的資訊,還包括硬體資訊,致使該結構很大很複雜。通過這個結構,核心在底層的網路驅動和網路層之間構建了乙個網路介面核心層 這個叫法引自 tcp遷移報告 這個中間層類似於檔案子系統的...
linux中網路程式設計I O模型 select
select函式原型 int select int maxfdp,fd set readfds,fd set writefds,fd set errorfds,struct timeval timeout 這裡用到兩個結構體fd set和timeval。fd set可以理解為乙個集合,時存放檔案描述...