課程介紹部分
1. 系統(tǒng)路由配置方法 centos6 centos7
查看系統(tǒng)路由表信息: netstat -rn / route -n / ip route show
2. 企業(yè)辦公環(huán)境上網(wǎng)原理
虛擬主機(jī)網(wǎng)絡(luò)通訊原理
3. 系統(tǒng)中常用網(wǎng)絡(luò)相關(guān)命令 ???
4. 綜合架構(gòu)組成部分
5. 綜合架構(gòu)服務(wù)準(zhǔn)備
a 系統(tǒng)基礎(chǔ)優(yōu)化配置
b 系統(tǒng)網(wǎng)絡(luò)配置
c 進(jìn)行虛擬主機(jī)克隆操作
-
課程知識(shí)回顧部分
- IP地址概念介紹 ipv4(書寫方式) ipv6
- IP地址分類說明
a IP地址按照范圍進(jìn)行劃分 A B C D E
b IP地址按照用途進(jìn)行劃分 私網(wǎng)地址(NAT) 公網(wǎng)地址
c IP地址按照通訊方式劃分 單播地址 組播地址 廣播地址 網(wǎng)絡(luò)地址
局域網(wǎng)主機(jī)數(shù)量=2的n次方-3
局域網(wǎng)子網(wǎng)數(shù)量=2的n次方 n表示子網(wǎng)位數(shù)量 - IP子網(wǎng)劃分方法
-
系統(tǒng)路由配置:
作用: 路由網(wǎng)絡(luò)線路可以進(jìn)行選路- 系統(tǒng)靜態(tài)默認(rèn)路由配置 (臨時(shí)配置)
centos6 (net-tools)
添加靜態(tài)默認(rèn)路由
[root@oldboyedu ~]# route add default gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.254 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
[root@oldboyedu ~]# 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=27.2 ms
刪除靜態(tài)默認(rèn)路由
[root@oldboyedu ~]# route del default gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
centos7 (iproute)
添加靜態(tài)默認(rèn)路由
[root@oldboyedu ~]# ip route add default via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.254 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
[root@oldboyedu ~]# 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=27.4 ms
刪除靜態(tài)默認(rèn)路由
[root@oldboyedu ~]# ip route del default via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0 - 系統(tǒng)靜態(tài)默認(rèn)路由配置 (臨時(shí)配置)
2) 系統(tǒng)靜態(tài)網(wǎng)段路由配置
centos6 (net-tools)
添加靜態(tài)網(wǎng)段路由
[root@oldboyedu ~]# route add -net 223.5.5.0 netmask 255.255.255.0 gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
223.5.5.0 10.0.0.254 255.255.255.0 UG 0 0 0 eth0
刪除靜態(tài)網(wǎng)段路由
route del -net 223.6.6.0 netmask 255.255.255.0 gw 10.0.0.254
centos7 (iproute)
添加靜態(tài)默認(rèn)路由
[root@oldboyedu ~]# ip route add 223.6.6.0/24 via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
223.6.6.0 10.0.0.254 255.255.255.0 UG 0 0 0 eth0
刪除靜態(tài)默認(rèn)路由
ip route del 223.6.6.0/24 via 10.0.0.254
3) 系統(tǒng)靜態(tài)主機(jī)路由配置
centos6 (net-tools)
添加靜態(tài)主機(jī)路由
[root@oldboyedu ~]# route add -host 223.5.5.5 gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
223.5.5.5 10.0.0.254 255.255.255.255 UGH 0 0 0 eth0
[root@oldboyedu ~]# 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=26.9 ms
[root@oldboyedu ~]# ping 223.5.5.6
connect: 網(wǎng)絡(luò)不可達(dá)
刪除靜態(tài)主機(jī)路由
route del -host 223.5.5.5 gw 10.0.0.254
centos7 (iproute)
添加靜態(tài)主機(jī)路由
[root@oldboyedu ~]# ip route add 223.5.5.5/32 via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
223.5.5.5 10.0.0.254 255.255.255.255 UGH 0 0 0 eth0
[root@oldboyedu ~]# 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=32.3 ms
[root@oldboyedu ~]# ping 223.5.5.6
connect: 網(wǎng)絡(luò)不可達(dá)
刪除靜態(tài)主機(jī)路由
ip route del 223.5.5.5/32 via 10.0.0.254