2019-08-14Day 29综合架构介绍

课程介绍部分
1. 系统路由配置方法 centos6 centos7
查看系统路由表信息: netstat -rn / route -n / ip route show
2. 企业办公环境上网原理
虚拟主机网络通讯原理
3. 系统中常用网络相关命令 ???
4. 综合架构组成部分
5. 综合架构服务准备
a 系统基础优化配置
b 系统网络配置
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. 系统路由配置:
    作用: 路由网络线路可以进行选路

    1. 系统静态默认路由配置 (临时配置)
      centos6 (net-tools)
      添加静态默认路由
      [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
      删除静态默认路由
      [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)
    添加静态默认路由
    [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
    删除静态默认路由
    [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) 系统静态网段路由配置
centos6 (net-tools)
添加静态网段路由
[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
删除静态网段路由
route del -net 223.6.6.0 netmask 255.255.255.0 gw 10.0.0.254

centos7 (iproute)
添加静态默认路由
[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
删除静态默认路由
ip route del 223.6.6.0/24 via 10.0.0.254

3) 系统静态主机路由配置
centos6 (net-tools)
添加静态主机路由
[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: 网络不可达
删除静态主机路由
route del -host 223.5.5.5 gw 10.0.0.254

centos7 (iproute)
添加静态主机路由
[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: 网络不可达
删除静态主机路由
ip route del 223.5.5.5/32 via 10.0.0.254

你可能感兴趣的:(2019-08-14Day 29综合架构介绍)