Manual:IP/DHCP Client: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Versions|v3, v4}} | {{Versions|v3, v4 +}} | ||
<div class=manual> | <div class=manual> | ||
==Summary== | |||
<p> | <p> | ||
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 the DHCP client obtains one, the route obtained by the DHCP client would be shown as invalid. | 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 the DHCP client obtains one, the route obtained by the DHCP client would be shown as invalid. | ||
</p> | </p> | ||
==Properties== | |||
<p><b>Sub-menu:</b> <code>/ip dhcp-client</code></p> | <p id="shbox"><b>Sub-menu:</b> <code>/ip dhcp-client</code></p> | ||
<br /> | |||
<table class="styled_table"> | <table class="styled_table"> | ||
Line 45: | Line 46: | ||
</tr> | </tr> | ||
</table> | </table> | ||
<br /> | |||
==Status== | |||
<p> | <p> | ||
Command <code>/ip dhcp-client print detail</code> will show current status of dhcp client and <b>read-only</b> properties listed in table below: | Command <code>/ip dhcp-client print detail</code> will show current status of dhcp client and <b>read-only</b> properties listed in table below: | ||
Line 101: | Line 103: | ||
</table> | </table> | ||
</p> | </p> | ||
<br /> | |||
==Menu specific commands== | |||
<table class="styled_table"> | <table class="styled_table"> | ||
Line 123: | Line 122: | ||
</tr> | </tr> | ||
</table> | </table> | ||
<br /> | |||
==Basic examples== | |||
Add a DHCP client on ether1 interface: | Add a DHCP client on ether1 interface: | ||
Line 140: | Line 139: | ||
</pre> | </pre> | ||
{{cont}} | |||
[[Category:Manual|D]] | [[Category:Manual|D]] | ||
[[Category:DHCP|C]] | [[Category:DHCP|C]] | ||
[[Category:IP|D]] | [[Category:IP|D]] |
Revision as of 12:57, 30 April 2010
Applies to RouterOS: v3, v4 +
Summary
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 the DHCP client obtains one, the route obtained by the DHCP client would be shown as invalid.
Properties
Sub-menu: /ip dhcp-client
Property | Description |
---|---|
add-default-route (yes | no; Default: yes) | Whether to install default route in routing table received from dhcp server. |
client-id (string; Default: ) | Corresponds to the settings suggested by the network administrator or ISP. If not specified, client's MAC address will be sent. |
default-route-distance (integer:0..255; Default: ) | Distance of default route. Applicable if add-default-route is set to yes . |
host-name (string; Default: ) | Tthe host name of the client sent to a DHCP server. If not specified, client's system identity will be used. |
interface (name; Default: ) | Interface on which DHCP client will be running. |
use-peer-dns (yes | no; Default: yes) | Whether to accept the DNS settings advertised by DHCP Server. (Will override the settings put in the /ip dns submenu |
use-peer-ntp (yes | no; Default: yes) | Whether to accept the NTP settings advertised by DHCP Server. (Will override the settings put in the /system ntp client submenu) |
Status
Command /ip dhcp-client print detail
will show current status of dhcp client and read-only properties listed in table below:
Property | Description |
---|---|
address (IP/mask) | IP address and netmask, which is assigned to DHCP Client from the Server |
dhcp-server (IP) | IP address of the DHCP server |
expires-after (time) | Time, when the lease expires (specified by the DHCP server) |
gateway (IP) | IP address of the gateway which is assigned by DHCP server |
invalid (yes | no) | Shows whether configuration is invalid. |
netmask (IP) | |
primary-dns (IP) | IP address of the primary DNS server, assigned by the DHCP server |
primary-ntp (IP) | IP address of the primary NTP server, assigned by the DHCP server |
secondary-dns (IP) | IP address of the secondary DNS server, assigned by the DHCP server |
secondary-ntp (IP) | IP address of the secondary NTP server, assigned by the DHCP server |
status (bound | error | rebinding... | requesting... | searching... | stopped) | Shows the status of DHCP Client |
Menu specific commands
Property | Description |
---|---|
release (id) | Release current binding and restart DHCP client |
renew (id) | Renew current leases. If the renew operation was not successful, client tries to reinitialize lease (i.e. it starts lease request procedure (rebind) as if it had not received an IP address yet) |
Basic examples
Add a DHCP client on ether1 interface:
/ip dhcp-client add interface=ether1 disabled=no [admin@MikroTik] ip dhcp-client> print detail Flags: X - disabled, I - invalid 0 interface=ether1 add-default-route=yes use-peer-dns=yes use-peer-ntp=yes status=bound address=192.168.0.65/24 gateway=192.168.0.1 dhcp-server=192.168.0.1 primary-dns=192.168.0.1 primary-ntp=192.168.0.1 expires-after=9m44s [admin@MikroTik] ip dhcp-client>
[ Top | Back to Content ]