mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
host-information: simplify documentation
This commit is contained in:
parent
2484e2f7c4
commit
07a59dd05d
@ -10,7 +10,6 @@ it covers the following topics:
|
||||
* Host name
|
||||
* Domain
|
||||
* IP address
|
||||
* Default gateway
|
||||
* Aliases
|
||||
|
||||
Hostname
|
||||
@ -18,131 +17,47 @@ Hostname
|
||||
|
||||
A hostname is the label (name) assigned to a network device (a host) on a
|
||||
network and is used to distinguish one device from another on specific networks
|
||||
or over the internet.
|
||||
or over the internet. On the other hand this will be the name which appears on
|
||||
the command line prompt.
|
||||
|
||||
Set a system host name:
|
||||
.. cfgcmd:: set system host-name '<hostname>'
|
||||
|
||||
.. code-block:: none
|
||||
Set system hostname. The hostname can be up to 63 characters. A hostname
|
||||
must start and end with a letter or digit, and have as interior characters
|
||||
only letters, digits, or a hyphen.
|
||||
|
||||
set system host-name <hostname>
|
||||
|
||||
.. note:: Only letters, numbers and hyphens are allowed.
|
||||
|
||||
Show host name:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
show system host-name
|
||||
|
||||
Delete host name:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
delete system host-name <hostname>
|
||||
|
||||
Example: Set system hostname to 'RT01':
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system host-name RT01
|
||||
commit
|
||||
show system host-name
|
||||
host-name RT01
|
||||
The default hostname used is `vyos`.
|
||||
|
||||
Domain Name
|
||||
===========
|
||||
|
||||
A domain name is the label (name) assigned to a computer network and is thus
|
||||
unique.
|
||||
unique. VyOS appends the domain name as a suffix to any unqualified name. For
|
||||
example, if you set the domain name `example.com`, and you would ping the
|
||||
unqualified name of `crux`, then VyOS qualifies the name to `crux.example.com`.
|
||||
|
||||
Set the system's domain:
|
||||
.. cfgcmd:: set system domain-name '<domain>'
|
||||
|
||||
.. code-block:: none
|
||||
Configure system domain name. A domain name must start and end with a letter
|
||||
or digit, and have as interior characters only letters, digits, or a hyphen.
|
||||
|
||||
set system domain-name <domain>
|
||||
Static Hostname Mapping
|
||||
=======================
|
||||
|
||||
.. note:: Only letters, numbers, hyphens and periods are allowed.
|
||||
How an IP address is assigned to an interface in :ref:`interfaces-addresses`.
|
||||
This section shows how to statically map an IP address to a hostname for local
|
||||
(meaning on this VyOS instance) name resolution.
|
||||
|
||||
Show domain:
|
||||
.. cfgcmd:: set system static-host-mapping host-name '<hostname>' inet '<address>'
|
||||
|
||||
.. code-block:: none
|
||||
Create a static hostname mapping which will always resolve the name
|
||||
`<hostname>` to IP address `<address>`.
|
||||
|
||||
show system domain-name
|
||||
|
||||
Remove domain name:
|
||||
.. cfgcmd:: set system static-host-mapping host-name '<hostname>' alias '<alias>'
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system delete domain-name <domain>
|
||||
|
||||
Example: Set system domain to example.com:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system domain-name example.com
|
||||
commit
|
||||
show system domain-name
|
||||
domain-name example.com
|
||||
|
||||
Static host mappings
|
||||
====================
|
||||
|
||||
How to assign IPs to interfaces is described in chapter
|
||||
:ref:`interfaces-addresses`. This section shows how to statically map a system
|
||||
IP to its host name for local (meaning on this VyOS instance) DNS resolution:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system static-host-mapping host-name <hostname> inet <IP address>
|
||||
|
||||
Show static mapping:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
show system static-host-mapping
|
||||
|
||||
Example: Create a static mapping between the system's hostname `RT01` and
|
||||
IP address `10.20.30.41`:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system static-host-mapping host-name RT01 inet 10.20.30.41
|
||||
commit
|
||||
show system static-host-mapping
|
||||
host-name RT01 {
|
||||
inet 10.20.30.41
|
||||
}
|
||||
|
||||
Aliases
|
||||
-------
|
||||
|
||||
One or more system aliases (static mappings) can be defined:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system static-host-mapping host-name <hostname> alias <alias>
|
||||
|
||||
Show aliases:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
show system static-mapping
|
||||
|
||||
Delete alias:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
delete system static-host-mapping host-name <hostname> alias <alias>
|
||||
|
||||
Example: Set alias `router1` for system with hostname `RT01`:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
set system static-host-mapping host-name RT01 alias router1
|
||||
commit
|
||||
show system static-host-mapping
|
||||
host-name RT01 {
|
||||
alias router1
|
||||
inet 10.20.30.41
|
||||
}
|
||||
Create named `<alias>` for the configured static mapping for `<hostname>`.
|
||||
Thus the address configured as :cfgcmd:`set system static-host-mapping
|
||||
host-name '<hostname>' inet '<address>'` can be reached via multiple names.
|
||||
|
||||
Multiple aliases can pe specified per host-name.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user