2019-08-14Day 29綜合架構介紹

課程介紹部分
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 進行虛擬主機克隆操作

  1. 課程知識回顧部分

    1. IP地址概念介紹 ipv4(書寫方式) ipv6
    2. IP地址分類說明
      a IP地址按照范圍進行劃分 A B C D E
      b IP地址按照用途進行劃分 私網地址(NAT) 公網地址
      c IP地址按照通訊方式劃分 單播地址 組播地址 廣播地址 網絡地址
      局域網主機數量=2的n次方-3
      局域網子網數量=2的n次方 n表示子網位數量
    3. IP子網劃分方法
  2. 系統(tǒng)路由配置:
    作用: 路由網絡線路可以進行選路

    1. 系統(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

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
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容