Sy9-dhcp/dns服务配置

前言、

课程需要(进入服务器综合配置使用阶段了),这里还是沿用桌面版的ubuntu来配置dhcp和dns,这里updated了新的版本。2024.5

server端环境:

Win11+VMS:192.168.105.1+192.168.105.128

(ubuntu2310)

Win11+VMS(centos8)

关于配置DHCP

第一种、

安装dhcpd组件,从官方文档vendor不再支持isc-dhcp-server,虽然目前任然可以使用其作为dhcp server。官方推荐使用kea代替。

root@testhost01:~# dhcpd

Command 'dhcpd' not found, but can be installed with:

apt install isc-dhcp-server       # version 4.4.3-P1-2ubuntu5, or

apt install isc-dhcp-server-ldap  # version 4.4.3-P1-2ubuntu5

root@testhost01:~# apt install isc-dhcp-server

How to install and configure isc-dhcp-server

Note:

Although Ubuntu still supports isc-dhcp-server, this software is no longer supported by its vendor. It has been replaced by Kea.

In this guide we show how to install and configure isc-dhcp-server, which installs the dynamic host configuration protocol daemon, dhcpd. For isc-kea instructions, refer to this guide instead.

Install isc-dhcp-server

At a terminal prompt, enter the following command to install isc-dhcp-server:

sudo apt install isc-dhcp-server

Note:

You can find diagnostic messages from dhcpd in syslog.

Configure isc-dhcp-server

You will probably need to change the default configuration by editing /etc/dhcp/dhcpd.conf to suit your needs and particular configuration.

Most commonly, what you want to do is assign an IP address randomly. This can be done with /etc/dhcp/dhcpd.conf settings as follows:

# minimal sample /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
   
subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.150 192.168.1.200;
 option routers 192.168.1.254;
 option domain-name-servers 192.168.1.1, 192.168.1.2;
 option domain-name "mydomain.example";
}

This will result in the DHCP server giving clients an IP address from the range 192.168.1.150 - 192.168.1.200. It will lease an IP address for 600 seconds if the client doesn’t ask for a specific time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also “advise” the client to use 192.168.1.254 as the default-gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.

You also may need to edit /etc/default/isc-dhcp-server to specify the interfaces dhcpd should listen to.

INTERFACESv4="eth4"

After changing the config files you need to restart the dhcpd service:

sudo systemctl restart isc-dhcp-server.service

来自 <https://ubuntu.com/server/docs/how-to-install-and-configure-isc-dhcp-server>

第二种、使用kea

How to setup Kea DHCPv4 Server with Ubuntu 23.10

In this article I will show you how to install and configure Kea DHCPv4 server on Ubuntu 23.10. Kea DHCP server is the successor of ISC DHCP server which recently got obsolete and is no longer maintained by ISC consortium.

S1Install kea dhcpv4 server

sudo apt update

sudo apt install kea-dhcp4-server

S2rename /etc/kea/kea-dhcp4.conf to kea-dhcp4.conf.bak 

sudo mv /etc/kea/kea-dhcp4.conf /etc/kea/kea-dhcp4.conf.bak

S3Create a new, empty configfile by using your favorite texteditor

sudo nano /etc/kea/kea-dhcp4.conf 

S4Copy/paste the content below and adjust the italic options as required

{

“Dhcp4”: {

“interfaces-config”: {

  “interfaces”: [ “ethx” ],

        “dhcp-socket-type”: “raw”

    },

    

    “control-socket”: {

        “socket-type”: “unix”,

        “socket-name”: “/run/kea/kea4-ctrl-socket”

    },

    

“authoritative”: true,

    

“lease-database”: {

    “type”: “memfile”,

        “persist”: true,

        “name”: “/var/lib/kea/kea-leases4.csv”,

    “lfc-interval”: 3600

},

        

    “renew-timer”: 15840,

    “rebind-timer”: 27720,

    “valid-lifetime”: 31680,

    “reservation-mode”: “out-of-pool”,

    

    “dhcp-ddns”: {

       “enable-updates”: true

    },

     

    “ddns-qualifying-suffix”: “smoky020.nl“,

    “ddns-override-client-update”: true,

    “ddns-override-no-update”: true,

    “ddns-replace-client-name”: “always”,

    “ddns-update-on-renew”: true,

     

    “option-data”: [

    {

      “name”: “domain-name-servers”,

      “data”: “ip address

    },

    {        

        “name”: “domain-search”,

        “data”: “smoky020.nl

    },

    {

      “name”: “domain-name”,

      “data”: “smoky020.nl

    }

  ],

    

        “loggers”: [ {

        “name”: “kea-dhcp4”,

        “output_options”: [ {

            “output”: “stdout”

    } 

    ],

        “severity”: “DEBUG”,

        “debuglevel”: 0

    } 

    ],

    “subnet4”: [

  {

    “id”: 1,

    “subnet”: “subnet/24“,

    

    “option-data”: [

    {

      “name”: “routers”,

      “data”: “ip address

    }

    ],

   

        “pools”: [

      {

        “pool”: “ip start – ip end

      }

    ],

        

        “reservations”: [

        {

            “hw-address”: “mac address“,

            “ip-address”: “ip address“,

            “hostname”: “hostname

        },   

        {

            “hw-address”: “mac address“,

            “ip-address”: “ip address“,

            “hostname”: “hostname

        } 

        ]

     }

     ]

  }

}

S5Save the .conf and restart kea dhcp4 server

sudo systemctl restart kea-dhcp4-server

来自 <How to setup Kea DHCPv4 Server with Ubuntu 23.10 – smoky020.nl>

第三种、ubuntu官方推荐的安装指导

How to install and configure isc-kea

In this guide we show how to install and configure isc-kea in Ubuntu 23.04

or greater. Kea is the DHCP server developed by ISC to replace isc-dhcp. It is newer and designed for more modern network environments.

For isc-dhcp-server instructions, refer to this guide instead.

配置指南中告诉你如何在Ubuntu 23.04中安装和配置isc-kea或更大Kea是ISC开发的DHCP服务器,用于取代isc-dhcp。这次更新,专为更现代的网络环境而设计。

S1、安装isc-kea

At a terminal prompt, enter the following command to install isc-kea:

在终端提示符下,输入以下命令安装isc-kea:

sudo apt install kea

这也将安装一些二进制包,包括

  • kea-dhcp4-server: The IPv4 DHCP server (the one we will configure in this guide).
  • kea-dhcp6-server: The IPv6 DHCP server.
  • kea-ctrl-agent: A REST API service for Kea.
  • kea-dhcp-ddns-server: A Dynamic DNS service to update DNS based on DHCP lease events.

由于kea-ctrl-agent服务对Kea具有一些管理权限服务,我们需要确保不允许普通用户使用没有许可API。Ubuntu通过要求用户身份验证来访问kea-ctrl-agent API服务(LP:#2007312有更多关于此的详细信息)。

因此,上述安装过程将获得一个debconf“高”优先级提示,有3个选项:

  • no action (default);no action(默认);
  • configure with a random password; or  使用随机密码进行配置;或
  • configure with a given password.  使用给定的密码进行配置。

如果没有密码,kea-ctrl-agent将无法启动。

The password is expected to be in /etc/kea/kea-api-password, with ownership

root:_kea and permissions 0640. To change it, run dpkg-reconfigure kea-ctrl-agent

(which will present the same 3 options from above again), or just edit the file

manually.

密码应该在/etc/kea/kea-api-password中,root具有_kea的权限(0640)。若要更改它,请运行dpkg-reconfigure kea-ctrl-agent(这将再次呈现上面相同的3个选项),或者只是手工编辑文件

S2Configure kea-dhcp4

可以通过编辑/etc/kea/kea-dhcp4.conf 来配置kea-dhcp4服务。

Most commonly, what you want to do is let Kea assign an IP address from a

pre-configured IP address pool. This can be done with settings as follows:

最常用情况是,让Kea预配置IP地址池。这可以通过如下代码设置来完成:

{
  "Dhcp4": {
        "interfaces-config": {
          "interfaces": [ "eth4" ]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/run/kea/kea4-ctrl-socket"
        },
        "lease-database": {
            "type": "memfile",
            "lfc-interval": 3600
        },
        "valid-lifetime": 600,
        "max-valid-lifetime": 7200,
        "subnet4": [
          {
            "id": 1,
            "subnet": "192.168.1.0/24",
            "pools": [
              {
                "pool": "192.168.1.150 - 192.168.1.200"
              }
            ],
            "option-data": [
              {
                "name": "routers",
                "data": "192.168.1.254"
              },
              {
                "name": "domain-name-servers",
                "data": "192.168.1.1, 192.168.1.2"
              },
              {
                "name": "domain-name",
                "data": "mydomain.example"
              }
            ]
          }
        ]
  }
}

这里让DHCP服务器侦听接口"eth4",为客户端提供范围192.168.1.150 - 192.168.1.200中的IP地址。如果客户端没有要求特定的时间范围,它将租用一个IP地址600秒。否则,最大(允许的)租用时间将为7200秒。服务器还将"建议"客户端使用192.168.1.254作为默认网关,使用192.168.1.1和192.168.1.2作为其DNS服务器。

在更改配置文件后,您可以使用以下命令通过kea-shell重新加载服务器配置:

kea-shell --host 127.0.0.1 --port 8000 --auth-user kea-api --auth-password $(cat /etc/kea/kea-api-password) --service dhcp4 config-reload

然后,按下ctrl-d提交交互信息。服务器应响应:

[ { "result": 0, "text": "Configuration successful." } ]

这意味着您的配置已被服务器接收。

kea-dhcp4-server服务日志应包含类似于以下内容的条目:

DHCP4_DYNAMIC_RECONFIGURATION_SUCCESS dynamic server reconfiguration succeeded with file: /etc/kea/kea-dhcp4.conf

这表示服务器已成功重新配置。

您可以使用kea-dhcp4-server读取journalctl服务日志:

journalctl -u kea-dhcp4-server

或者,不通过以下方式重新加载DHCP 4服务器配置kea-shell,您可以使用以下命令重新启动kea-dhcp4-service:

systemctl restart kea-dhcp4-server

来自 <https://ubuntu.com/server/docs/how-to-install-and-configure-isc-kea>

---第三部分是配置FTP/NFS相关的---

关于配置DNS

同样,这里直接copy来了ubuntu官方文档来让童鞋们参考。^V^

有任何看不懂的随时艾特我。

Domain Name Service (DNS)

Domain Name Service (DNS) is an Internet service that maps IP addresses and fully qualified domain names (FQDN) to one another. In this way, DNS alleviates the need to remember IP addresses. Computers that run DNS are called name servers. Ubuntu ships with the Berkley Internet Naming Daemon (BIND), the most common program used for maintaining a name server on Linux.

Install DNS

At a terminal prompt, run the following command to install the bind9 package:

sudo apt install bind9

A useful package for testing and troubleshooting DNS issues is the dnsutils package. Very often these tools will be installed already, but to check and/or install dnsutils enter the following:

sudo apt install dnsutils

DNS configuration overview

There are many ways to configure BIND9. Some of the most common configurations include a caching nameserver, primary server, and secondary server.

  • When configured as a caching nameserver, BIND9 will find the answer to name queries and remember the answer when the domain is queried again.
  • As a primary server, BIND9 reads the data for a zone from a file on its host, and is authoritative for that zone.
  • As a secondary server, BIND9 gets the zone data from another nameserver that is authoritative for the zone.

Configuration files

The DNS configuration files are stored in the /etc/bind directory. The primary configuration file is /etc/bind/named.conf, which in the layout provided by the package just includes these files:

  • /etc/bind/named.conf.options: Global DNS options
  • /etc/bind/named.conf.local: For your zones
  • /etc/bind/named.conf.default-zones: Default zones such as localhost, its reverse, and the root hints

The root nameservers used to be described in the file /etc/bind/db.root. This is now provided instead by the /usr/share/dns/root.hints file shipped with the dns-root-data package, and is referenced in the named.conf.default-zones configuration file above.

It is possible to configure the same server to be a caching name server, primary, and secondary: it all depends on the zones it is serving. A server can be the Start of Authority (SOA) for one zone, while providing secondary service for another zone. All the while providing caching services for hosts on the local LAN.

Set up a caching nameserver

The default configuration acts as a caching server. Simply uncomment and edit /etc/bind/named.conf.options to set the IP addresses of your ISP’s DNS servers:

forwarders {
    1.2.3.4;
    5.6.7.8;
};

Note:

Replace 1.2.3.4 and 5.6.7.8 with the IP addresses of actual nameservers.

To enable the new configuration, restart the DNS server. From a terminal prompt, run:

sudo systemctl restart bind9.service

See dig for information on testing a caching DNS server.

Set up a primary server

In this section BIND9 will be configured as the primary server for the domain example.com. You can replace example.com with your FQDN (Fully Qualified Domain Name).

Forward zone file

To add a DNS zone to BIND9, turning BIND9 into a primary server, first edit /etc/bind/named.conf.local:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
};

Note:

If BIND will be receiving automatic updates to the file as with DDNS, then use /var/lib/bind/db.example.com rather than /etc/bind/db.example.com both here and in the copy command below.

Now use an existing zone file as a template to create the /etc/bind/db.example.com file:

sudo cp /etc/bind/db.local /etc/bind/db.example.com

Edit the new zone file /etc/bind/db.example.com and change localhost. to the FQDN of your server, including the additional . at the end. Change 127.0.0.1 to the nameserver’s IP address and root.localhost to a valid email address, but with a . instead of the usual @ symbol, again including the . at the end. Change the comment to indicate the domain that this file is for.

Create an A record for the base domain, example.com. Also, create an A record for ns.example.com, the name server in this example:

;
; BIND data file for example.com
;
$TTL    604800
@       IN      SOA     example.com. root.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

@       IN      NS      ns.example.com.
@       IN      A       192.168.1.10
@       IN      AAAA    ::1
ns      IN      A       192.168.1.10

You must increment the Serial Number every time you make changes to the zone file. If you make multiple changes before restarting BIND9, only increment Serial once.

Now, you can add DNS records to the bottom of the zone file. See Common Record Types for details.

Note:

Many admins like to use the “last edited” date as the Serial of a zone, such as 2020012100 which is yyyymmddss (where ss is the Serial Number)

Once you have made changes to the zone file, BIND9 needs to be restarted for the changes to take effect:

sudo systemctl restart bind9.service

Reverse zone file

Now that the zone is set up and resolving names to IP Addresses, a reverse zone needs to be added to allows DNS to resolve an address to a name.

Edit /etc/bind/named.conf.local and add the following:

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/db.192";
};

Note:

Replace 1.168.192 with the first three octets of whatever network you are using. Also, name the zone file /etc/bind/db.192 appropriately. It should match the first octet of your network.

Now create the /etc/bind/db.192 file:

sudo cp /etc/bind/db.127 /etc/bind/db.192

Next edit /etc/bind/db.192, changing the same options as /etc/bind/db.example.com:

;
; BIND reverse data file for local 192.168.1.XXX net
;
$TTL    604800
@       IN      SOA     ns.example.com. root.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.
10      IN      PTR     ns.example.com.

The Serial Number in the reverse zone needs to be incremented on each change as well. For each A record you configure in /etc/bind/db.example.com that is for a different address, you will need to create a PTR record in /etc/bind/db.192.

After creating the reverse zone file restart BIND9:

sudo systemctl restart bind9.service

Set up a secondary server

Once a primary server has been configured, a secondary server is highly recommended. This will maintain the availability of the domain if the primary becomes unavailable.

First, on the primary server, the zone transfer needs to be allowed. Add the allow-transfer option to the example Forward and Reverse zone definitions in /etc/bind/named.conf.local:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
    allow-transfer { 192.168.1.11; };
};
   
zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/db.192";
    allow-transfer { 192.168.1.11; };
};

Note:

Replace 192.168.1.11 with the IP address of your secondary nameserver.

Restart BIND9 on the primary server:

sudo systemctl restart bind9.service

Next, on the secondary server, install the bind9 package the same way as on the primary. Then edit the /etc/bind/named.conf.local and add the following declarations for the Forward and Reverse zones:

zone "example.com" {
    type secondary;
    file "db.example.com";
    masters { 192.168.1.10; };
};       
         
zone "1.168.192.in-addr.arpa" {
    type secondary;
    file "db.192";
    masters { 192.168.1.10; };
};

Once again, replace 192.168.1.10 with the IP address of your primary nameserver, then restart BIND9 on the secondary server:

sudo systemctl restart bind9.service

In /var/log/syslog you should see something similar to the following (some lines have been split to fit the format of this document):

client 192.168.1.10#39448: received notify for zone '1.168.192.in-addr.arpa'
zone 1.168.192.in-addr.arpa/IN: Transfer started.
transfer of '100.18.172.in-addr.arpa/IN' from 192.168.1.10#53:
 connected using 192.168.1.11#37531
zone 1.168.192.in-addr.arpa/IN: transferred serial 5
transfer of '100.18.172.in-addr.arpa/IN' from 192.168.1.10#53:
 Transfer completed: 1 messages,
6 records, 212 bytes, 0.002 secs (106000 bytes/sec)
zone 1.168.192.in-addr.arpa/IN: sending notifies (serial 5)
   
client 192.168.1.10#20329: received notify for zone 'example.com'
zone example.com/IN: Transfer started.
transfer of 'example.com/IN' from 192.168.1.10#53: connected using 192.168.1.11#38577
zone example.com/IN: transferred serial 5
transfer of 'example.com/IN' from 192.168.1.10#53: Transfer completed: 1 messages,
8 records, 225 bytes, 0.002 secs (112500 bytes/sec)

Note:

A zone is only transferred if the Serial Number on the primary is larger than the one on the secondary. If you want to have your primary DNS notify other secondary DNS servers of zone changes, you can add also-notify { ipaddress; }; to /etc/bind/named.conf.local as shown in the example below:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
    allow-transfer { 192.168.1.11; };
    also-notify { 192.168.1.11; };
};

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/db.192";
    allow-transfer { 192.168.1.11; };
    also-notify { 192.168.1.11; };
};
   

Note:

The default directory for non-authoritative zone files is /var/cache/bind/. This directory is also configured in AppArmor to allow the named daemon to write to it. See this page for more information on AppArmor.

Testing your setup

resolv.conf

The first step in testing BIND9 is to add the nameserver’s IP address to a hosts resolver. The Primary nameserver should be configured as well as another host to double check things. Refer to DNS client configuration for details on adding nameserver addresses to your network clients. In the end your nameserver line in /etc/resolv.conf should be pointing at 127.0.0.53 and you should have a search parameter for your domain. Something like this:

nameserver  127.0.0.53
search example.com

To check which DNS server your local resolver is using, run:

resolvectl status

Note:

You should also add the IP address of the secondary nameserver to your client configuration in case the primary becomes unavailable.

dig

If you installed the dnsutils package you can test your setup using the DNS lookup utility dig:

After installing BIND9 use dig against the loopback interface to make sure it is listening on port 53. From a terminal prompt:

dig -x 127.0.0.1

You should see lines similar to the following in the command output:

;; Query time: 1 msec
;; SERVER: 192.168.1.10#53(192.168.1.10)

If you have configured BIND9 as a caching nameserver, “dig” an outside domain to check the query time:

dig ubuntu.com

Note the query time toward the end of the command output:

;; Query time: 49 msec

After a second dig there should be improvement:

;; Query time: 1 msec

ping

Now let’s demonstrate how applications make use of DNS to resolve a host name, by using the ping utility to send an ICMP echo request:

ping example.com

This tests if the nameserver can resolve the name ns.example.com to an IP address. The command output should resemble:

PING ns.example.com (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.800 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.813 ms

named-checkzone

A great way to test your zone files is by using the named-checkzone utility installed with the bind9 package. This utility allows you to make sure the configuration is correct before restarting BIND9 and making the changes live.

To test our example forward zone file, enter the following from a command prompt:

named-checkzone example.com /etc/bind/db.example.com

If everything is configured correctly you should see output similar to:

zone example.com/IN: loaded serial 6
OK

Similarly, to test the reverse zone file enter the following:

named-checkzone 1.168.192.in-addr.arpa /etc/bind/db.192

The output should be similar to:

zone 1.168.192.in-addr.arpa/IN: loaded serial 3
OK

Note:

The Serial Number of your zone file will probably be different.

Quick temporary query logging

With the rndc tool, you can quickly turn query logging on and off, without restarting the service or changing the configuration file.

To turn query logging on, run:

sudo rndc querylog on

Likewise, to turn it off, run:

sudo rndc querylog off

The logs will be sent to syslog and will show up in /var/log/syslog by default:

Jan 20 19:40:50 new-n1 named[816]: received control channel command 'querylog on'
Jan 20 19:40:50 new-n1 named[816]: query logging is now on
Jan 20 19:40:57 new-n1 named[816]: client @0x7f48ec101480 192.168.1.10#36139 (ubuntu.com): query: ubuntu.com IN A +E(0)K (192.168.1.10)

Note:

The amount of logs generated by enabling querylog could be huge!

Logging

BIND9 has a wide variety of logging configuration options available, but the two main ones are channel and category, which configure where logs go, and what information gets logged, respectively.

If no logging options are configured the default configuration is:

logging {
     category default { default_syslog; default_debug; };
     category unmatched { null; };
};

Let’s instead configure BIND9 to send debug messages related to DNS queries to a separate file.

We need to configure a channel to specify which file to send the messages to, and a category. In this example, the category will log all queries. Edit /etc/bind/named.conf.local and add the following:

logging {
    channel query.log {
        file "/var/log/named/query.log";
        severity debug 3;
    };
    category queries { query.log; };
};

Note:

The debug option can be set from 1 to 3. If a level isn’t specified, level 1 is the default.

Since the named daemon runs as the bind user, the /var/log/named directory must be created and the ownership changed:

sudo mkdir /var/log/named
sudo chown bind:bind /var/log/named

Now restart BIND9 for the changes to take effect:

sudo systemctl restart bind9.service

You should see the file /var/log/named/query.log fill with query information. This is a simple example of the BIND9 logging options. For coverage of advanced options see the “Further Reading” section at the bottom of this page.

Common record types

This section covers some of the most common DNS record types.

  • A record
    This record maps an IP address to a hostname.
    www      IN    A      192.168.1.12
  • CNAME record
    Used to create an alias to an existing A record. You cannot create a CNAME record pointing to another CNAME record.
    web     IN    CNAME  www
  • MX record
    Used to define where emails should be sent to. Must point to an A record, not a CNAME.
    @       IN    MX  1   mail.example.com.
    mail    IN    A       192.168.1.13
  • NS record
    Used to define which servers serve copies of a zone. It must point to an A record, not a CNAME. This is where primary and secondary servers are defined.
    @       IN    NS     ns.example.com.
    @       IN    NS     ns2.example.com.
    ns      IN    A      192.168.1.10
    ns2     IN    A      192.168.1.11

来自 <https://ubuntu.com/server/docs/domain-name-service-dns>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/7268.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vivado UltraScale 比特流设置

下表所示 UltraScale ™ 器件的器件配置设置可搭配 set_property <Setting> <Value> [current_design] Vivado 工具 Tcl 命令一起使用。

第08章 IP分类编址和无分类编址

8.1 本章目标 了解IP地址的用途和种类了解分类编址和无分类编址区别掌握IP地址、子网掩码、网关概念及使用掌握子网划分及超网划分方法掌握无分类编址的改变和使用 8.2 IP地址的用途和种类 分类编址&#xff1a;造成地址的浪费&#xff0c;以及地址不够用&#xff1b;无分类编…

【QEMU系统分析之实例篇(十八)】

系列文章目录 第十八章 QEMU系统仿真的机器创建分析实例 文章目录 系列文章目录第十八章 QEMU系统仿真的机器创建分析实例 前言一、QEMU是什么&#xff1f;二、QEMU系统仿真的机器创建分析实例1.系统仿真的命令行参数2.创建后期后端驱动qemu_create_late_backends()qtest_serv…

寒武纪及瑞芯微平台调用加速调研

文章目录 1 寒武纪加速平台简介1.1 加速平台简介1.1.1 算力硬件1.1.2 配套软件 1.2 部署流程简介1.3 部署环境搭建1.3.1 安装驱动1.3.2 安装CNToolKit1.3.3 配置模型移植开发环境 1.4 模型部署1.4.1 模型转换旧文件格式1.4.2 量化模型生成1.4.3 验证结果1.4.4 离线模型生成 1 寒…

【自用】了解移动存储卡的基本信息

前言 本文是看B站视频做的一个简单笔记&#xff0c;方便日后自己快速回顾&#xff0c;内容主要介绍了存储卡基本参数&#xff0c;了解卡面上的数字、图标代表的含义。对于日后如何挑选判断一张存储卡的好坏、判别一张存储卡是否合格有一定帮助。 视频参考链接&#xff1a;【硬…

【StarRocks系列】 Trino 方言支持

我们在之前的文章中&#xff0c;介绍了 Doris 官方提供的两种方言转换工具&#xff0c;分别是 sql convertor 和方言 plugin。StarRocks 目前同样也提供了类似的方言转换功能。本文我们就一起来看一下这个功能的实现与 Doris 相比有何不同。 一、Trino 方言验证 我们可以通过…

HTTP、RTSP、RTMP、RTP,RTCP,HLS,MMS的概念、区别、用法

背景知识 先有TCP/IP协议簇 5层模型&#xff0c;后有DoD 4层模型&#xff0c;再有OSI 7层模型。 TCP/IP协议簇&#xff08;TCP/IP Suite&#xff09;除了代表TCP与IP这两种通讯协议外&#xff0c;更包含了与TCP/IP相关的数十种通讯协议&#xff0c;例如&#xff1a;SMTP、DNS、…

使用docker-compose编排Lnmp(dockerfile) 完成Wordpress

目录 一、 Docker-Compose 1.1Docker-Compose介绍 1.2环境准备 1.2.1准备容器目录及相关文件 1.2.2关闭防火墙关闭防护 1.2.3下载centos:7镜像 1.3Docker-Compose 编排nginx 1.3.1切换工作目录 1.3.2编写 Dockerfile 文件 1.3.3修改nginx.conf配置文件 1.4Docker-Co…

Terraform代码的check块

check块是Terraform 1.5开始引入的新功能。 过去可以在resource块里的lifecycle块中验证基础设施的状态&#xff0c;check块填补了在apply后验证基础设施状态这一功能的空白。check块允许定义在每次plan以及apply操作后执行的自定义的验证。check块定义的验证逻辑是作为plan和a…

01嵌入式面经

华为嵌入式 stm32单片机和51单片机的区别 架构&#xff1a; STM32单片机&#xff1a;基于ARM Cortex-M系列处理器&#xff0c;具有先进的32位处理能力和丰富的外设资源。51单片机&#xff1a;基于Intel 8051系列处理器&#xff0c;是一种经典的8位单片机&#xff0c;具有较为简…

SpringBoot+Vue+Element-UI实现学生综合成绩测评系统

前言介绍 学生成绩是高校人才培养计划的重要组成部分&#xff0c;是实现人才培养目标、培养学生科研能力与创新思维、检验学生综合素质与实践能力的重要手段与综合性实践教学环节。而学生所在学院多采用半手工管理学生成绩的方式&#xff0c;所以有必要开发学生综合成绩测评系…

MySql 空间索引

在 MySQL 中&#xff0c;直接对几何数据类型&#xff08;如 POINT, LINESTRING, POLYGON 等&#xff09;使用 "几何索引" 的概念并不完全准确&#xff0c;因为 MySQL 不直接提供名为 "几何索引" 的索引类型。但是&#xff0c;你可以为这些几何数据类型创建…

机器学习——2.损失函数loss

基本概念 损失函数也叫代价函数。损失函数就是计算预测结果和实际结果差距的函数&#xff0c;机器学习的过程就是试图将损失函数的值降到最小。 图左&#xff1a;&#xff5c;t_p - t_c&#xff5c; 图右&#xff1a;&#xff08;t_p - t_c&#xff09;**2 代码实…

图像分割入门-Unet++理论与实践

探索 U-net&#xff1a;改进的图像分割神经网络 引言 图像分割是计算机视觉领域中的重要任务&#xff0c;旨在将图像中的每个像素分配到特定的类别或区域。在许多应用中&#xff0c;如医学影像分析、自动驾驶和地块识别等领域&#xff0c;图像分割都扮演着关键角色。 U-net …

echars设置渐变颜色的方法

在我们日常的开发中&#xff0c;难免会遇到有需求&#xff0c;需要使用echars设置渐变的图表&#xff0c;如果我们需要设置给图表设置渐变颜色的话&#xff0c;我们只需要在 series 配置项中 添加相应的属性配置项即可。 方式一&#xff1a;colorStops type&#xff1a;‘lin…

基于EWT联合SVD去噪

一、代码原理 &#xff08;1&#xff09;基于EWT-SVD的信号去噪算法原理 经验小波变换&#xff08;Empirical Wavelet Transform&#xff0c;EWT&#xff09;&#xff1a;EWT是一种基于信号局部特征的小波变换方法&#xff0c;能够更好地适应非线性和非平稳信号的特性。奇异值…

Maria DB 安装(含客户端),看这一篇就够了

文章目录 一 安装前准备1 版本与Win平台对应2 推荐安装 二 安装步骤1 安装主体程序2 添加系统路径Path 三 客户端 一 安装前准备 1 版本与Win平台对应 版本对应关系可参考&#xff1a; https://www.codebye.com/mariadb-deprecated-package-platforms.html。 2 推荐安装 经…

AI工具如何改变我们的工作与生活

AI工具在当今社会中扮演着越来越重要的角色&#xff0c;它们已经开始改变着我们的工作方式和生活方式。在接下来的2000字篇幅中&#xff0c;我将详细探讨AI工具如何影响我们的工作和生活。 AI工具在工作中的影响&#xff1a; 自动化和智能化生产流程&#xff1a; AI工具可以通…

嵌入式开发软件编码规范——C语言编码规范大全总结(规范开发,快乐你我他她它)

【系列专栏】:博主结合工作实践输出的,解决实际问题的专栏,朋友们看过来! 《项目案例分享》 《极客DIY开源分享》 《嵌入式通用开发实战》 《C++语言开发基础总结》 《从0到1学习嵌入式Linux开发》 《QT开发实战》 《Android开发实战》

【driver1】内核模块,设备号,字符驱动

文章目录 1.内核模块&#xff1a;必须包含module.h2.内核模块参数&#xff1a;权限位S_IRUGO是用在sysfs文件系统里2.1 extern&#xff1a;声明来自另一个模块 3.设备号&#xff1a;主设备号对应驱动程序&#xff0c;具有相同主设备号设备使用相同驱动程序&#xff0c;次设备号…