unit11 網路管理

2021-07-30 11:58:19 字數 3179 閱讀 8172

unit11.管理網路

1.ip基礎知識

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位為主機位

2.配置ip

1.圖形介面

nm-connection-editor

2.文字化圖形

ifconfig 網絡卡ip netmask    ##臨時設定

dhcp        ##動態獲取

vim /etc/sysconfig/network-scripts/ifcfg-eth0

device=eth0     ##介面使用裝置

bootproto=dhcp      ##網絡卡工作模式

onboot=yes      ##網路服務開啟時自動啟用

name=eth0       ##網路介面名稱

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

systemctl restart netwrok

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

ip  主機名稱

4.本地解析檔案和dns讀取的優先順序調整

/etc/nsswitch.conf

38 #hosts:     db files nisplus nis dns

39 hosts:      files dns       ##files代表本地解析檔案,dns代表dns伺服器,那個在前面那個優先

5.dhcp服務的配置

unit11 管理文件

unit11 管理文件 一,ip 基礎知識 1,ipv4 2進製32位 10進製 172.25.0.10 252.255.255.0 255.255.255.0 子網掩碼 子網掩碼255位對應的ip位為網路位 子網掩碼0 位對應的ip位為主機位 二,配置ip 圖形化 1,圖形介面 nm connec...

linux基礎unit11 管理網路

unit11 管理網路 1.ip基礎知識 ipv4 2進製32位 172.25.0.10 255.255.255.0 255.255.255.0 子網掩碼 子網掩碼255位對應的ip位為網路位 子網掩碼0對應的ip位為主機位 2.配置ip 圖形化 1 圖形介面 nm connection edito...

RHEL7 UNIT11 網路管理

11.管理網路 1.ip基礎知識 1.ipv4 2進製32位 10進製 172.25.0.10 255.255.255.0 255.255.255.0 子網掩碼 子網掩碼255位對應的ip位為網路位 子網掩碼0對應的ip位為主機位 2.配置ip 圖形化 1.圖形介面 nm connection ed...