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;无分类编…

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

文章目录 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…

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

前言介绍 学生成绩是高校人才培养计划的重要组成部分&#xff0c;是实现人才培养目标、培养学生科研能力与创新思维、检验学生综合素质与实践能力的重要手段与综合性实践教学环节。而学生所在学院多采用半手工管理学生成绩的方式&#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 推荐安装 经…

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

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

cURL:命令行下的网络工具

序言 在当今互联网时代&#xff0c;我们经常需要与远程服务器通信&#xff0c;获取数据、发送请求或下载文件。在这些情况下&#xff0c;cURL 是一个强大而灵活的工具&#xff0c;它允许我们通过命令行进行各种类型的网络交互。本文将深入探讨 cURL 的基本用法以及一些高级功能…

C++:特殊类的设计 | 单例模式

目录 1、特殊类的设计 2、设计一个类&#xff0c;不能被拷贝 3、设计一个类&#xff0c;只能在堆上创建对象 4、设计一个类&#xff0c;只能在栈上创建对象 5、设计一个类&#xff0c;不能被继承 6、单例模式 1、饿汉模式 2、懒汉模式 1、特殊类的设计 在实际应用场景中…

系统镜像地址

系统镜像 Linux 官网下载地址&#xff1a;Downloadhttps://www.centos.org/download/ 阿里云镜像下载地址&#xff1a;https://mirrors.aliyun.com/centos/https://mirrors.aliyun.com/centos/?spma2c6h.13651104.d-2001.6.6554320cwFqB8E 清华大学镜像下载地址&#xff1…

SCI一区 | WOA-BiTCN-BiGRU-Attention多输入单输出回归预测(Matlab)

SCI一区 | WOA-BiTCN-BiGRU-Attention多输入单输出回归预测&#xff08;Matlab&#xff09; 目录 SCI一区 | WOA-BiTCN-BiGRU-Attention多输入单输出回归预测&#xff08;Matlab&#xff09;效果一览基本介绍程序设计参考资料 效果一览 基本介绍 1.Matlab实现WOA-BiTCN-BiGRU-A…

【C++】学习笔记——list

文章目录 八、list1. list的介绍2. list的使用3. list的模拟实现4. list模拟实现的代码整合1. list.h2. test.cpp 未完待续 八、list list链接 1. list的介绍 是的&#xff0c; list 就是带头双向循环链表。 2. list的使用 通过 string 和 vector 的学习&#xff0c;我们差…

基于TL431和CSA的恒压与负压输出

Hello uu们,51去那里玩了呀?该收心回来上班了,嘿嘿! 为什么会有这个命题,因为我的手头只有这些东西如何去实现呢?让我们一起来看电路图吧.电路图如下图1所示 图1:CSA恒压输出电路 图1中,R1给U2提供偏置,Q1给R1提供电流,当U1-VOUT输出大于2.5V时候,U2内部的三极管CE导通,使得…