1)如何調(diào)整主機(jī)位數(shù)量(VLSM可變長子網(wǎng)掩碼方式)
- 為什么要調(diào)整主機(jī)位??
- 對(duì)大的網(wǎng)絡(luò)進(jìn)行子網(wǎng)劃分
01.容易造成地址浪費(fèi)
02.容易造成嚴(yán)重的廣播風(fēng)暴
03.容易造成網(wǎng)絡(luò)擁塞 路由器壓力過大
- 對(duì)大的網(wǎng)絡(luò)進(jìn)行子網(wǎng)劃分
子網(wǎng)劃分好處:
01.避免地址產(chǎn)生浪費(fèi)(公網(wǎng)地址)
02.可以降低廣播風(fēng)暴問題
03.降低網(wǎng)絡(luò)擁塞罚缕,減輕路由器壓力
2)如何子網(wǎng)劃分
- 將一個(gè)大的子網(wǎng)變?yōu)槎鄠€(gè)小的子網(wǎng)==較少的主機(jī)位
01.子網(wǎng)較少主機(jī)位艇纺,將主機(jī)位變?yōu)榫W(wǎng)絡(luò)位
02.調(diào)整劃分網(wǎng)絡(luò)子網(wǎng)掩碼
03.獲得每個(gè)子網(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
02. VLAN概念(交換網(wǎng)絡(luò))
LAN --- 局域網(wǎng)接口 內(nèi)網(wǎng)接口
VLAN --- 虛擬局域網(wǎng)
VLAN : 將交換機(jī)邏輯劃分為多個(gè)虛擬局域網(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