Bo's Oracle Station

查看: 1459|回复: 0

课程第2次:2020-02-15星期六

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-2-15 20:46:30 | 显示全部楼层 |阅读模式
1. /etc/dhcp/dhcpd.conf:

  1. ddns-update-style none;
  2. subnet 192.168.0.0 netmask 255.255.255.0 {
复制代码

  1. option routers 192.168.0.254;
  2.         option subnet-mask 255.255.255.0;
  3.         option domain-name "example.com";
  4.         option domain-name-servers 192.168.0.254;
  5.         default-lease-time 21600;
  6.         max-lease-time 43200;
复制代码
PXE特别需要:
  1. filename "/var/ftp/pub/workstation.cfg";
复制代码
PXE特别需要:tftp
  1. next-server classroom.example.com;
复制代码


PXE极其需要:
  1. option space PXE;
  2. class "PXE" {
  3.         match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  4.                 option vendor-encapsulated-options 01:04:00:00:00:00:ff;
  5.                         option boot-size 0x1;
  6.                         filename "pxelinux.0";
  7.                         option tftp-server-name "classroom.example.com";
  8.                         option vendor-class-identifier "PXEClient";
  9.                         vendor-option-space PXE;
  10. }
复制代码


可选的配置:要在subnet大范围之内


  1. host desktop3 {
  2.                  hardware ethernet  00:0C:29:E7:1C:6D;
  3.                  fixed-address  192.168.0.3;

  4. }
复制代码
2. 测试名字服务器:


  1. [root@classroom ~]# dig desktop4.example.com

  2. ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> desktop4.example.com
  3. ;; global options: +cmd
  4. ;; Got answer:
  5. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26722
  6. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

  7. ;; OPT PSEUDOSECTION:
  8. ; EDNS: version: 0, flags:; udp: 4096
  9. ; COOKIE: e885426657c53e0cdfd9e9b95e47e7568f4b425f66b9f448 (good)
  10. ;; QUESTION SECTION:
  11. ;desktop4.example.com.          IN      A

  12. ;; ANSWER SECTION:
  13. desktop4.example.com.   86400   IN      A       192.168.0.4

  14. ;; AUTHORITY SECTION:
  15. example.com.            86400   IN      NS      classroom.example.com.

  16. ;; ADDITIONAL SECTION:
  17. classroom.example.com.  86400   IN      A       192.168.0.254

  18. ;; Query time: 4 msec
  19. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  20. ;; WHEN: Sat Feb 15 20:43:02 CST 2020
  21. ;; MSG SIZE  rcvd: 133

  22. [root@classroom ~]# dig server4.example.com

  23. ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> server4.example.com
  24. ;; global options: +cmd
  25. ;; Got answer:
  26. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31197
  27. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

  28. ;; OPT PSEUDOSECTION:
  29. ; EDNS: version: 0, flags:; udp: 4096
  30. ; COOKIE: 1d37347955f443018107858c5e47e75eac3190a29a03cfb3 (good)
  31. ;; QUESTION SECTION:
  32. ;server4.example.com.           IN      A

  33. ;; ANSWER SECTION:
  34. server4.example.com.    86400   IN      A       192.168.0.104

  35. ;; AUTHORITY SECTION:
  36. example.com.            86400   IN      NS      classroom.example.com.

  37. ;; ADDITIONAL SECTION:
  38. classroom.example.com.  86400   IN      A       192.168.0.254

  39. ;; Query time: 0 msec
  40. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  41. ;; WHEN: Sat Feb 15 20:43:10 CST 2020
  42. ;; MSG SIZE  rcvd: 132

  43. [root@classroom ~]# dig example.com

  44. ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> example.com
  45. ;; global options: +cmd
  46. ;; Got answer:
  47. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6299
  48. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

  49. ;; OPT PSEUDOSECTION:
  50. ; EDNS: version: 0, flags:; udp: 4096
  51. ; COOKIE: c33afce287191a70de495cf05e47e765fdcc491c5133902f (good)
  52. ;; QUESTION SECTION:
  53. ;example.com.                   IN      A

  54. ;; ANSWER SECTION:
  55. example.com.            86400   IN      A       192.168.0.254

  56. ;; AUTHORITY SECTION:
  57. example.com.            86400   IN      NS      classroom.example.com.

  58. ;; ADDITIONAL SECTION:
  59. classroom.example.com.  86400   IN      A       192.168.0.254

  60. ;; Query time: 2 msec
  61. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  62. ;; WHEN: Sat Feb 15 20:43:17 CST 2020
  63. ;; MSG SIZE  rcvd: 124

  64. [root@classroom ~]# dig -t mx example.com

  65. ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> -t mx example.com
  66. ;; global options: +cmd
  67. ;; Got answer:
  68. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46251
  69. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

  70. ;; OPT PSEUDOSECTION:
  71. ; EDNS: version: 0, flags:; udp: 4096
  72. ; COOKIE: 315b836166cbe9a74171ba255e47e76da0e04046dad5e097 (good)
  73. ;; QUESTION SECTION:
  74. ;example.com.                   IN      MX

  75. ;; ANSWER SECTION:
  76. example.com.            86400   IN      MX      10 classroom.example.com.

  77. ;; AUTHORITY SECTION:
  78. example.com.            86400   IN      NS      classroom.example.com.

  79. ;; ADDITIONAL SECTION:
  80. classroom.example.com.  86400   IN      A       192.168.0.254

  81. ;; Query time: 0 msec
  82. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  83. ;; WHEN: Sat Feb 15 20:43:25 CST 2020
  84. ;; MSG SIZE  rcvd: 124

  85. [root@classroom ~]# dig  cracker133.cracker.org

  86. ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> cracker133.cracker.org
  87. ;; global options: +cmd
  88. ;; Got answer:
  89. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16721
  90. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

  91. ;; OPT PSEUDOSECTION:
  92. ; EDNS: version: 0, flags:; udp: 4096
  93. ; COOKIE: ce1b38effdbb9d52f198b2415e47e7a697516f8a5156156e (good)
  94. ;; QUESTION SECTION:
  95. ;cracker133.cracker.org.                IN      A

  96. ;; ANSWER SECTION:
  97. cracker133.cracker.org. 86400   IN      A       192.168.1.133

  98. ;; AUTHORITY SECTION:
  99. cracker.org.            86400   IN      NS      server1.cracker.org.

  100. ;; ADDITIONAL SECTION:
  101. server1.cracker.org.    86400   IN      A       192.168.1.254

  102. ;; Query time: 1 msec
  103. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  104. ;; WHEN: Sat Feb 15 20:44:22 CST 2020
  105. ;; MSG SIZE  rcvd: 133

  106. [root@classroom ~]# ping  cracker133.cracker.org
  107. PING cracker133.cracker.org (192.168.1.133) 56(84) bytes of data.
  108. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=1 ttl=64 time=0.496 ms
  109. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=2 ttl=64 time=0.336 ms
  110. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=3 ttl=64 time=0.387 ms
  111. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=4 ttl=64 time=0.363 ms
  112. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=5 ttl=64 time=0.410 ms
  113. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=6 ttl=64 time=0.319 ms
  114. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=7 ttl=64 time=0.352 ms
  115. 64 bytes from cracker133.cracker.org (192.168.1.133): icmp_seq=8 ttl=64 time=2.20 ms
复制代码

3. 解释一台CLASSROOM后半段:

从430行开始:
什么是CA ?任何浏览器(操作系统)都内嵌8个CA的公钥。 RHCE密码学-->数字签名-->CA拿它的私钥“处理”你的公钥。https (https的公钥被签名)。

时间必需要同步,line 443-481 时间服务器chronyd

4. 如何成为CA(x509格式只要一般了解):

  1. openssl req -days 3650 -new -x509 -nodes -out example-ca.crt -keyout private/example-ca.key -subj '/C=US/ST=North Carolina/L=Raleigh/O=Example, Inc./CN=example.com Certificate Authority'
复制代码




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 03:13 , Processed in 0.044204 second(s), 24 queries .

快速回复 返回顶部 返回列表