子網(wǎng)掩碼

1)如何調(diào)整主機(jī)位數(shù)量(VLSM可變長子網(wǎng)掩碼方式)

  • 為什么要調(diào)整主機(jī)位??
    • 對大的網(wǎng)絡(luò)進(jìn)行子網(wǎng)劃分
      01.容易造成地址浪費(fèi)
      02.容易造成嚴(yán)重的廣播風(fēng)暴
      03.容易造成網(wǎng)絡(luò)擁塞 路由器壓力過大
子網(wǎng)劃分好處:

01.避免地址產(chǎn)生浪費(fèi)(公網(wǎng)地址)
02.可以降低廣播風(fēng)暴問題
03.降低網(wǎng)絡(luò)擁塞,減輕路由器壓力

2)如何子網(wǎng)劃分

  • 將一個大的子網(wǎng)變?yōu)槎鄠€小的子網(wǎng)==較少的主機(jī)位
    01.子網(wǎng)較少主機(jī)位,將主機(jī)位變?yōu)榫W(wǎng)絡(luò)位
    02.調(diào)整劃分網(wǎng)絡(luò)子網(wǎng)掩碼
    03.獲得每個子網(wǎng)絡(luò)主機(jī)范圍

2.1 什么是掩碼

  • 掩碼也是有32位二進(jìn)制數(shù)組成,沒八位為一組 總共4組
  • 如何設(shè)置掩碼:掩碼信息的設(shè)置需要參照IP地址信息

IP  172.16.0.0  --  10101100.00010000. 00000000 00000000
掩碼                 11111111.11111111. 00000000 00000000 == 255.255.0.0
網(wǎng)絡(luò)位為1

image.png
02. VLAN概念(交換網(wǎng)絡(luò))
    LAN  --- 局域網(wǎng)接口 內(nèi)網(wǎng)接口
    VLAN --- 虛擬局域網(wǎng)
    VLAN : 將交換機(jī)邏輯劃分為多個虛擬局域網(wǎng)


03. 系統(tǒng)中如何添加路由信息
                       centos6                                   centos7
    靜態(tài)默認(rèn)路由    route add default gw 10.0.0.254              ip route add default via 10.0.0.254
    靜態(tài)網(wǎng)段路由    route add -net  223.5.5.0/24 gw 10.0.0.254   ip route add 223.5.5.0/24 via 10.0.0.254
    靜態(tài)主機(jī)路由    route add -host 223.5.5.5/32 gw 10.0.0.254   ip route add 223.5.5.5/32 via 10.0.0.254
    
    靜態(tài)默認(rèn)路由
    [root@oldboyedu-55 ~]# ip route add default via 10.0.0.254
    [root@oldboyedu-55 ~]# ip route show
    default via 10.0.0.254 dev ens33 
    10.0.0.0/24 dev ens33 proto kernel scope link src 10.0.0.200 
    169.254.0.0/16 dev ens33 scope link metric 1002 
    [root@oldboyedu-55 ~]# ping 223.5.5.5
    PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
    64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=43.2 ms
    64 bytes from 223.5.5.5: icmp_seq=2 ttl=128 time=43.8 ms
    ^C
    --- 223.5.5.5 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1002ms
    rtt min/avg/max/mdev = 43.205/43.512/43.820/0.371 ms

    靜態(tài)網(wǎng)段路由 
    [root@oldboyedu-55 ~]# ip route add 223.5.5.0/24 via 10.0.0.254
    [root@oldboyedu-55 ~]# ip route show
    10.0.0.0/24 dev ens33 proto kernel scope link src 10.0.0.200 
    169.254.0.0/16 dev ens33 scope link metric 1002 
    223.5.5.0/24 via 10.0.0.254 dev ens33 
    [root@oldboyedu-55 ~]# ping 223.5.5.5
    PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
    64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=42.6 ms
    64 bytes from 223.5.5.5: icmp_seq=2 ttl=128 time=87.3 ms
    64 bytes from 223.5.5.5: icmp_seq=3 ttl=128 time=43.7 ms
    
    靜態(tài)主機(jī)路由
    [root@oldboyedu-55 ~]# ip route add 223.5.5.5/32 via 10.0.0.254
    [root@oldboyedu-55 ~]# ip route show
    10.0.0.0/24 dev ens33 proto kernel scope link src 10.0.0.200 
    169.254.0.0/16 dev ens33 scope link metric 1002 
    223.5.5.5 via 10.0.0.254 dev ens33 
    [root@oldboyedu-55 ~]# ping 223.5.5.5
    PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
    64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=43.5 ms
    64 bytes from 223.5.5.5: icmp_seq=2 ttl=128 time=43.3 ms
    64 bytes from 223.5.5.5: icmp_seq=3 ttl=128 time=43.2 ms
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容