mikrotik dhcp offered что это

Mikrotik dhcp offered что это

Бесплатный чек-лист
по настройке RouterOS
на 28 пунктов

Offering lease without success. Странная проблема с DHCP.

Правила форума
Как правильно оформить вопрос.
Прежде чем начать настройку роутера, представьте, как это работает. Попробуйте почитать статьи об устройстве интернет-сетей. Убедитесь, что всё, что Вы задумали выполнимо вообще и на данном оборудовании в частности.
Не нужно изначально строить Наполеоновских планов. Попробуйте настроить простейшую конфигурацию, а усложнения добавлять в случае успеха постепенно.
Пожалуйста, не игнорируйте правила русского языка. Отсутствие знаков препинания и неграмотность автора топика для многих гуру достаточный повод проигнорировать топик вообще.

1. Назовите технологию подключения (динамический DHCP, L2TP, PPTP или что-то иное)
2. Изучите темку «Действия до настройки роутера».
viewtopic.php?f=15&t=2083
3. Настройте согласно выбранного Вами мануала
4. Дочитайте мануал до конца и без пропусков, в 70% случаев люди просто не до конца читают статью и пропускают важные моменты.
5. Если не получается, в Winbox открываем терминал и вбиваем там /export hide-sensitive. Результат в топик под кат, интимные подробности типа личных IP изменить на другие, пароль забить звездочками.
6. Нарисуйте Вашу сеть, рисунок (схему) сюда. На словах может быть одно, в действительности другое.

Есть вариант, что в сети есть второй DHCP сервер, который отдал клиенту IP раньше, чем это успел сделать микротик.

Еще есть вариант, что на микротике включен DHCP клиент, который что-то там не получает. А должен ли?

Вот здесь это обсуждается https://forum.mikrotik.com/viewtopic.php?t=130176
однозначно эффективного решения нет.

Хотя, справедливости ради, надо сказать, что с моим парком микротиков (наверное уже более 100 единиц) ни разу с такой ошибкой и проблемой не сталкивался. Надо искать проблему в физической организации сети.

Есть вариант, что в сети есть второй DHCP сервер, который отдал клиенту IP раньше, чем это успел сделать микротик.

Еще есть вариант, что на микротике включен DHCP клиент, который что-то там не получает. А должен ли?

Вот здесь это обсуждается https://forum.mikrotik.com/viewtopic.php?t=130176
однозначно эффективного решения нет.

Хотя, справедливости ради, надо сказать, что с моим парком микротиков (наверное уже более 100 единиц) ни разу с такой ошибкой и проблемой не сталкивался. Надо искать проблему в физической организации сети.

Микротики есть разные: черные, белые, красные. Но все равно хочется над чем нибудь заморочится.

Источник

Manual:IP/DHCP Server

Applies to RouterOS: v3, v4, v5+

Contents

Summary

Standards: RFC 2131, RFC 3315, RFC 3633
Package: dhcp

The DHCP (Dynamic Host Configuration Protocol) is used for the easy distribution of IP addresses in a network. The MikroTik RouterOS implementation includes both server and client parts and is compliant with RFC 2131.

The router supports an individual server for each Ethernet-like interface. The MikroTik RouterOS DHCP server supports the basic functions of giving each requesting client an IP address/netmask lease, default gateway, domain name, DNS-server(s) and WINS-server(s) (for Windows clients) information (set up in the DHCP networks submenu)

In order for the DHCP server to work, IP pools must also be configured (do not include the DHCP server’s own IP address into the pool range) and the DHCP networks.

It is also possible to hand out leases for DHCP clients using the RADIUS server; the supported parameters for a RADIUS server is as follows:

Note: DHCP server requires a real interface to receive raw ethernet packets. If the interface is a Bridge interface, then the Bridge must have a real interface attached as a port to that bridge which will receive the raw ethernet packets. It cannot function correctly on a dummy (empty bridge) interface.

Quick Setup Guide

RouterOS has a built in command that lets you easily set up a DHCP server. Let’s say we want to configure DHCP server on ether1 interface to lease addresses from 192.168.0.2 to 192.168.0.254 which belong to the 192.168.0.0/24 network. The gateway and DNS server is 192.168.0.1.

From /ip dhcp-server menu run setup command and follow instructions:

The wizard has made the following configuration based on the answers above:

Starting from v5.8 RouterOS supports IPv6 prefix delegation according to RFC 3315 and RFC 3633.

Starting from v5.9, DHCPv6 server configuration was moved to /ipv6 sub-menu. Read-more >>

General

Sub-menu: /ip dhcp-server

Menu specific commands

Property Description
setup ( ) Start DHCP server setup wizard, which guides you through the steps to easily create all necessary configuration. Read more>>

Lease Store Configuration

Sub-menu: /ip dhcp-server config

This sub-menu allows the configuration of how often the DHCP leases will be stored on disk. If they would be saved on disk on every lease change, a lot of disk writes would happen which is very bad for Compact Flash (especially, if lease times are very short). To minimize writes on disk, all changes are saved on disk every store-leases-disk seconds. Additionally leases are always stored on disk on graceful shutdown and reboot.

This sub-menu has only one configurable property:

Property Description
store-leases-disk (time | immediately | never; Default: 5m) How frequently lease changes should be stored on disk

Networks

Sub-menu: /ip dhcp-server network

Leases

Sub-menu: /ip dhcp-server lease

Generally, the DHCP lease it allocated as follows:

A client may free the leased address. The dynamic lease is removed, and the allocated address is returned to the address pool. But the static lease becomes busy until the client reacquires the address.

Note: IP addresses assigned statically are not probed!

Properties

Warning: The always-broadcast parameter will dynamically change. For the initial DHCP discover/offer/request/ack cycle a broadcast MAC address is going to be used, for lease renewal (request and ack) an unicast MAC address will be used. In case the DHCP Server keeps receiving DHCP requests while DHCP offer has been sent, then the always-broadcast parameter will be turned on dynamically until the DHCP lease has been renewed successfully.

Читайте также:  Что значит трещать по швам

Read only properties

Menu specific commands

Property Description
check-status (id) Check status of a given busy dynamic lease, and free it in case of no response
make-static (id) Convert a dynamic lease to a static one

Rate limiting

It is possible to set a bandwidth to a specific IPv4 address by using DHCPv4 leases. This can be done by setting a rate limit on the DHCPv4 lease itself, by doing this a dynamic simple queue rule will be added for the IPv4 address that corresponds to the DHCPv4 lease. By using the rate-limit parameter you can conveniently limit a user’s bandwidth.

Note: For any queues to work properly, the traffic must not be FastTracked, make sure your Firewall does not FastTrack traffic that you want to limit.

First, make the DHCPv4 lease static, otherwise it will not be possible to set a rate limit to a DHCPv4 lease:

Then you can set a rate to a DHCPv4 lease that will create a new dynamic simple queue entry:

Note: By default allow-dual-stack-queue is enabled, this will add a single dynamic simple queue entry for both DCHPv6 binding and DHCPv4 lease, without this option enabled separate dynamic simple queue entries will be added for IPv6 and IPv4.

If allow-dual-stack-queue is enabled, then a single dynamic simple queue entry will be created containing both IPv4 and IPv6 addresses:

RADIUS Support

Since RouterOS v6.43 it is possible to use RADIUS to assign a rate-limit per lease, to do so you need to pass the Mikrotik-Rate-Limit attribute from your RADIUS Server for your lease. To achieve this you first need to set your DHCPv4 Server to use RADIUS for assigning leases. Below is an example how to set it up:

After that you need to tell your RADIUS Server to pass the Mikrotik-Rate-Limit attribute. In case you are using FreeRADIUS with MySQL, then you need to add appropriate entries into radcheck and radreply tables for a MAC address, that is being used for your DHCPv4 Client. Below is an example for table entries:

Alerts

Sub-menu: /ip dhcp-server alert

To find any rogue DHCP servers as soon as they appear in your network, DHCP Alert tool can be used. It will monitor the ethernet interface for all DHCP replies and check if this reply comes from a valid DHCP server. If a reply from an unknown DHCP server is detected, alert gets triggered:

When the system alerts about a rogue DHCP server, it can execute a custom script.

Properties

Property Description
alert-timeout (none | time; Default: none) Time after which alert will be forgotten. If after that time the same server is detected, new alert will be generated. If set to none timeout will never expire.
interface (string; Default: ) Interface, on which to run rogue DHCP server finder.
on-alert (string; Default: ) Script to run, when an unknown DHCP server is detected.
valid-server (string; Default: ) List of MAC addresses of valid DHCP servers.

Read only properties

Property Description
unknown-server (string) List of MAC addresses of detected unknown DHCP servers. Server is removed from this list after alert-timeout

Menu specific commands

DHCP Options

Sub-menu: /ip dhcp-server option

With the help of DHCP Option list, it is possible to define additional custom options for DHCP Server to advertise. Option precedence is as follows:

This is the order in which client option request will be filled in.

According to the DHCP protocol, a parameter is returned to the DHCP client only if it requests this parameter, specifying the respective code in DHCP request Parameter-List (code 55) attribute. If the code is not included in Parameter-List attribute, the DHCP server will not send it to the DHCP client.

Properties

Property Description
code (integer:1..254; Default: ) dhcp option code. All codes are available at http://www.iana.org/assignments/bootp-dhcp-parameters
name (string; Default: ) Descriptive name of the option
value (string; Default: ) Parameter’s value.

Starting from v6.8 available data types for options are:

RouterOS has predefined variables that can be used:

Now it is also possible to combine data types into one, for example: «0x01’vards’$(HOSTNAME)»

For example if HOSTNAME is ‘kvm’, then raw value will be 0x0176617264736b766d.

raw-value (HEX string ) Read only field which shows raw dhcp option value (the format actually sent out)

Example

A classless route adds specified route in clients routing table. In our example, it will add

According to RFC 3442: The first part is the netmask («18» = netmask /24). Second part is significant part of destination network («A00000» = 160.0.0). Third part is IP address of gateway («0A016501» = 10.1.101.1). Then There are parts of the default route, destination netmask (0x00 = 0.0.0.0/0) followed by default route (0x0A016501 = 10.1.101.1)

Much more robust way would be to use built in variables, previous example can be rewritten as:

DHCP Option Sets

Sub-menu: /ip dhcp-server option sets

This menu allows combining multiple options in option sets, which later can be used to override default DHCP server option set.

Property Description
name (string; Default: ) Name of the option set.
options (list; Default: ) List of options defined in options menu.

Vendor Classes

Since 6.45beta6 version RouterOS support vendor class id matcher. The vendor class is used by DHCP clients to optionally identify the vendor and configuration.

Property Description
name (string; Default: ) Self explained
sever (string; Default: all) Specific DHCP server to match
address-pool (string; Default: ) Address pool for a particular Vendor ID (VID)
vid (string; Default: ) Vendor Class ID matcher

Example

In the following configuration example, we will give an IP address from a particular pool for an Android based mobile phone. We will use the RouterBOARD with a default configuration

Configure vendor-class-id matcher. DHCP servers configuration remains default

Connect your mobile phone to the device to receive an IP address from 172.16.16.0 network

Configuration Examples

To simply configure DHCP server you can use a setup command.

First, you configure IP address on the interface:

Then you use setup command which will automatically ask necessary parameters:

That is all. You have configured an active DHCP server.

Источник

Mikrotik dhcp offered что это

Thu Feb 23, 2017 5:37 am

Hi, can i ask you. i’ve got small network with VLANs, i’ve seen on my MT antualy on DHCP server » offered». What is that means? How can i fix it up?

If both SSIDs are good quality signal, most modern devices choose 5GHz for the speed.
viewtopic.php?f=7&t=176537

!) Safe Mode is your friend;

Re: DHCP server says «offered»

Fri Feb 24, 2017 11:43 am

the DHCP server offering leases to hosts in your net is perfectly fine.
There might be a problem with DHCP in VLANs, caused by faulty MTU settings: If DHCP server offers leases «without success», try increasing the MTU of the VLAN interfaces to 1504.

Re: DHCP server says «offered»

Fri Feb 24, 2017 5:33 pm

Or problem with bridge
Rstp/stp/none

Sent from my iPhone using Tapatalk Pro

Re: DHCP server says «offered»

Fri Feb 24, 2017 6:13 pm

Do a packet capture on the host and make sure the full DHCP process is completing. The phases are listed here. We use the acronym DORA for short.

Re: DHCP server says «offered»

Sat Feb 25, 2017 10:24 am

Thanks a lot, the problem has been on vlan-configuration, and the main MT doesn’t know how to manage with the rest of MT.

Just one thing how can i access to the rest of MT? Will be good idea if i do another VLAN(just for accessing) What is your recommendation?

Источник

DHCP Client

Summary

The DHCP (Dynamic Host Configuration Protocol) is used for the easy distribution of IP addresses in a network. The MikroTik RouterOS implementation includes both server and client parts and is compliant with RFC 2131.

The MikroTik RouterOS DHCP client may be enabled on any Ethernet-like interface at a time. The client will accept an address, netmask, default gateway, and two DNS server addresses. The received IP address will be added to the interface with the respective netmask. The default gateway will be added to the routing table as a dynamic entry. Should the DHCP client be disabled or not renew an address, the dynamic default route will be removed. If there is already a default route installed prior to the DHCP client obtaining one, the route obtained by the DHCP client would be shown as invalid.

RouterOS DHCP client asks for the following options:

Option

DHCP client has the possibility to set up options that are sent to the DHCP server. For example, hostname and MAC address. The syntax is the same as for DHCP server options.

Currently, there are three variables that can be used in options:

DHCP client default options include these default Options:

Name code value
clientid_duid 61 0xff$(CLIENT_DUID)
clientid 61 0x01$(CLIENT_MAC)
hostname 12 $(HOSTNAME)

DHCP Client can receive delegated prefixes from the DHCPv6 server. The currently received prefix is added to the IPv6 pool, which later can be used for example in PPPoE server configuration. DHCPv6 client configuration can be found in the /ipv6 sub-menu

Setup example

Add a DHCP client on ether1 interface:

After the interface is added, you can use the «print» or «print detail» command to see what parameters the DHCP client acquired:

If the interface used by the DHCP client is part of the VRF configuration, then the default route and other received routes from the DHCP server will be added to the VRF routing table.

DHCP client status can be checked with:

Examples

Lease script example

It is possible to execute a script when a DHCP client obtains a new lease or loses an existing one. This is an example script that automatically adds a default route with routing-mark=WAN1 and removes it when the lease expires or is removed.

Resolve default gateway when ‘router’ (option3) is from a different subnet

In some cases, administrators tend to set the ‘router’ option which cannot be resolved with offered IP’s subnet. For example, the DHCP server offers 192.168.88.100/24 to the client, and option 3 is set to 172.16.1.1. This will result in an unresolved default route:

To fix this we need to add /32 route to resolve the gateway over ether1, which can be done by the running script below each time the DHCP client gets an address

Now we can further extend the script, to check if the address already exist, and remove the old one if changes are needed

DHCP Server

The DHCP (Dynamic Host Configuration Protocol) is used for the easy distribution of IP addresses in a network. The MikroTik RouterOS implementation includes both server and client parts and is compliant with RFC 2131.

The router supports an individual server for each Ethernet-like interface. The MikroTik RouterOS DHCP server supports the basic functions of giving each requesting client an IP address/netmask lease, default gateway, domain name, DNS-server(s) and WINS-server(s) (for Windows clients) information (set up in the DHCP networks submenu)

In order for the DHCP server to work, IP pools must also be configured (do not include the DHCP server’s own IP address into the pool range) and the DHCP networks.

It is also possible to hand out leases for DHCP clients using the RADIUS server; the supported parameters for a RADIUS server are as follows:

DHCP server requires a real interface to receive raw ethernet packets. If the interface is a Bridge interface, then the Bridge must have a real interface attached as a port to that bridge which will receive the raw ethernet packets. It cannot function correctly on a dummy (empty bridge) interface.

Lease Store Configuration

This sub-menu allows the configuration of how often the DHCP leases will be stored on disk. If they would be saved on a disk on every lease change, a lot of disk writes would happen which is very bad for Compact Flash (especially, if lease times are very short). To minimize writes on disk, all changes are saved on disk every store-leases-disk seconds. Additionally, leases are always stored on disk on graceful shutdown and reboot.

Leases

DHCP server lease submenu is used to monitor and manage server leases. The issued leases are shown here as dynamic entries. You can also add static leases to issue a specific IP address to a particular client (identified by MAC address).

Generally, the DHCP lease is allocated as follows:

A client may free the leased address. The dynamic lease is removed, and the allocated address is returned to the address pool. But the static lease becomes busy until the client reacquires the address.

IP addresses assigned statically are not probed!

Parameters

Properties

Network

Rate limiting

It is possible to set the bandwidth to a specific IPv4 address by using DHCPv4 leases. This can be done by setting a rate limit on the DHCPv4 lease itself, by doing this a dynamic simple queue rule will be added for the IPv4 address that corresponds to the DHCPv4 lease. By using the rate-limit parameter you can conveniently limit a user’s bandwidth.

For any queues to work properly, the traffic must not be FastTracked, make sure your Firewall does not FastTrack traffic that you want to limit.

First, make the DHCPv4 lease static, otherwise, it will not be possible to set a rate limit to a DHCPv4 lease:

Then you can set a rate to a DHCPv4 lease that will create a new dynamic simple queue entry:

By default allow-dual-stack-queue is enabled, this will add a single dynamic simple queue entry for both DCHPv6 binding and DHCPv4 lease, without this option enabled separate dynamic simple queue entries will be added for IPv6 and IPv4.

If allow-dual-stack-queue is enabled, then a single dynamic simple queue entry will be created containing both IPv4 and IPv6 addresses:

RADIUS Support

Since RouterOS v6.43 it is possible to use RADIUS to assign a rate limit per lease, to do so you need to pass the Mikrotik-Rate-Limit attribute from your RADIUS Server for your lease. To achieve this you first need to set your DHCPv4 Server to use RADIUS for assigning leases. Below is an example of how to set it up:

After that, you need to tell your RADIUS Server to pass the Mikrotik-Rate-Limit attribute. In case you are using FreeRADIUS with MySQL, then you need to add appropriate entries into radcheck and radreply tables for a MAC address, that is being used for your DHCPv4 Client. Below is an example for table entries:

Ошибка визуализации кода макроса: задано недействительное значение для параметра «com.atlassian.confluence.ext.code.render.InvalidValueException»

Alerts

To find any rogue DHCP servers as soon as they appear in your network, the DHCP Alert tool can be used. It will monitor the ethernet interface for all DHCP replies and check if this reply comes from a valid DHCP server. If a reply from an unknown DHCP server is detected, an alert gets triggered:

When the system alerts about a rogue DHCP server, it can execute a custom script.

DHCP Options

With the help of the DHCP Option list, it is possible to define additional custom options for DHCP Server to advertise. Option precedence is as follows:

This is the order in which the client option request will be filled in.

According to the DHCP protocol, a parameter is returned to the DHCP client only if it requests this parameter, specifying the respective code in the DHCP request Parameter-List (code 55) attribute. If the code is not included in the Parameter-List attribute, the DHCP server will not send it to the DHCP client, but since RouterOS v7.1rc5 it is possible to force the DHCP option from the server-side even if the DHCP-client does not request such parameter:

Properties

RouterOS has predefined variables that can be used:

Now it is also possible to combine data types into one, for example: «0x01’vards’$(HOSTNAME)»

For example if HOSTNAME is ‘kvm’, then raw value will be 0x0176617264736b766d.

raw-value (HEX string ) Read-only field which shows raw DHCP option value (the format actually sent out)

Example

Classless Route

A classless route adds a specified route in the clients routing table. In our example, it will add

According to RFC 3442: The first part is the netmask («18» = netmask /24). Second part is significant part of destination network («A00000» = 160.0.0). Third part is IP address of gateway («0A016501» = 10.1.101.1). Then There are parts of the default route, destination netmask (0x00 = 0.0.0.0/0) followed by default route (0x0A016501 = 10.1.101.1)

Источник

Читайте также:  частота 2 4 ггц что это такое
Сказочный портал