課程介紹部分
1. 系統(tǒng)路由配置方法 centos6 centos7
查看系統(tǒng)路由表信息: netstat -rn / route -n / ip route show
2. 企業(yè)辦公環(huán)境上網原理
虛擬主機網絡通訊原理
3. 系統(tǒng)中常用網絡相關命令 ???
4. 綜合架構組成部分
5. 綜合架構服務準備
a 系統(tǒng)基礎優(yōu)化配置
b 系統(tǒng)網絡配置
c 進行虛擬主機克隆操作
-
課程知識回顧部分
- IP地址概念介紹 ipv4(書寫方式) ipv6
- IP地址分類說明
a IP地址按照范圍進行劃分 A B C D E
b IP地址按照用途進行劃分 私網地址(NAT) 公網地址
c IP地址按照通訊方式劃分 單播地址 組播地址 廣播地址 網絡地址
局域網主機數量=2的n次方-3
局域網子網數量=2的n次方 n表示子網位數量 - IP子網劃分方法
-
系統(tǒng)路由配置:
作用: 路由網絡線路可以進行選路- 系統(tǒng)靜態(tài)默認路由配置 (臨時配置)
centos6 (net-tools)
添加靜態(tài)默認路由
[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)默認路由
[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)默認路由
[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)默認路由
[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)默認路由配置 (臨時配置)
2) 系統(tǒng)靜態(tài)網段路由配置
centos6 (net-tools)
添加靜態(tài)網段路由
[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)網段路由
route del -net 223.6.6.0 netmask 255.255.255.0 gw 10.0.0.254
centos7 (iproute)
添加靜態(tài)默認路由
[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)默認路由
ip route del 223.6.6.0/24 via 10.0.0.254
3) 系統(tǒng)靜態(tài)主機路由配置
centos6 (net-tools)
添加靜態(tài)主機路由
[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: 網絡不可達
刪除靜態(tài)主機路由
route del -host 223.5.5.5 gw 10.0.0.254
centos7 (iproute)
添加靜態(tài)主機路由
[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: 網絡不可達
刪除靜態(tài)主機路由
ip route del 223.5.5.5/32 via 10.0.0.254