Basic system configuration
Configuring host information
This section includes the following examples:
Setting the hostname of the system
Setting the domain name of the system
Mapping the IP address of the system to its hostname
Setting the default gateway
Creating an alias for the system
vyatta@vyatta# set system host-name R1
vyatta@vyatta# commit comment "setting host-name"
vyatta@vyatta# exit
vyatta@vyatta:~$ configure
vyatta@R1# set system domain-name mydomain.com
vyatta@R1# set system static-host-mapping host-name R1 inet 10.0.0.65
vyatta@R1# set protocols static route 0.0.0.0/0 next-hop 172.16.0.254
vyatta@R1# set system static-host-mapping host-name R1 alias finance1
vyatta@R1# compare
[edit system]
+domain-name mydomain.com
+static-host-mapping {
+ host-name R1 {
+ alias finance1
+ inet 10.0.0.65
+ }
+}
[edit]
+protocols {
+ static {
+ route 0.0.0.0/0 {
+ next-hop 172.16.0.254
+ }
+ }
+}
vyatta@R1# commit comment "setting host information"
vyatta@R1# exit
Hostname
The name of the DANOS vRouter is set by using the system host-name
command. A system name can include letters, numbers, and hyphens (-).
Line 1 shows setting the host-name to “R1”.
Domain
The name of the DANOS vRouter is set by using the system host-name command. A system name can include letters, numbers, and hyphens (-).
The system domain-name
and system domain-search
commands are mutually exclusive. Only one of the two commands can be configured at any one time.
Line 5 shows setting the domain to “mydomain.com”.
IP address
The IP address of the system can be statically mapped to its hostname for local DNS purposes by using the system static-hostmapping
command.
IP networks are specified in CIDR format—that is, in IP-address /prefix notation such as 192.168.12.0/24. For a single address, use dotted-quad format, that is, a.b.c.d. For a network prefix, enter a decimal number from 1 through 32.
A good practice is to map the hostname of the system to the loopback address because the loopback interface is the most reliable on the system. In this example, the loopback interface is given the 10.0.0.65 address. This address is configured for the loopback interface in the sample topology used in this guide.
Line 6 shows setting the mapping between R1 hostname and 10.0.0.65 IP address.
Default gateway
Line 7 shows setting the default gateway for the system to be 172.16.0.254.
Aliases
You can define one or more aliases for the system by mapping the IP address of the system to more than one hostname.
Line 8 shows setting the finance1 alias for the system.
Configuring DNS
DNS name servers
DNS name servers are specified by using the system name-server
command.
The order in which the DNS name servers are added to the configuration is the order in which they are
accessed.
The following example shows how to specify two DNS name servers for the system: one at 172.16.0.34 and the other at 10.10.40.34.
vyatta@R1# set system name-server 172.16.0.34
vyatta@R1# set system name-server 10.10.40.34
vyatta@R1# compare
[edit system]
+name-server 172.16.0.34
+name-server 10.10.40.34
vyatta@R1# commit comment "setting DNS name-servers"
vyatta@R1# exit
Domain search order
You can specify a list of domains for the system to use to complete an unqualified hostname. To define this list, specify the order in which domains are searched by using the system domain-search
command.
The system domain-name
and system domain-search
commands are mutually exclusive. Only one of the two commands can be configured at any one time.
The system domain-search
command requires that you enter each domain name separately, specified in the order you want them searched. A domain name can include letters, numbers, hyphens (-), and periods (.).
The following example shows how to direct the system to attempt domain completion in the following order: first, mydomain.com; second, mydomain.net; and last mydomain.org.
vyatta@R1# set system domain-search domain mydomain.com
vyatta@R1# set system domain-search domain mydomain.net
vyatta@R1# set system domain-search domain mydomain.org
vyatta@R1# compare
[edit system]
+domain-search {
+ domain mydomain.com
+ domain mydomain.net
+ domain mydomain.org
+}
vyatta@R1# commit comment "setting DNS domain-search"
vyatta@R1# exit
Configuring date and time
Date and time can be either set manually or obtained by manually or automatically synchronizing the system with one or more Network Time Protocol (NTP) servers. The time zone must be manually set and may be specified as an offset from Universal Coordinated Time (UTC) or as one of a number of supported literal time zones.
In this section, sample configurations are presented for maintaining date and time information. The following figure shows the sample date and time information.
Setting the date
The following table shows how to manually set the date to 1:15 PM exactly on April 24, 2007. The format is MMDDhhmmCCYY. Alternate formats are MMDDhhmm, MMDDhhmmYY, and MMDDhhmmCCYY.ss.
To manually set the date, perform the following steps in operational mode.
vyatta@R1:~$ set date 042413152007
Manually synchronizing with an NTP server
The following example shows how to manually synchronize the system clock with the NTP server at 172.16.0.42.
Note that this action performs just a one-time synchronization. It does not set up an ongoing association with the NTP server. For information about setting up automatic synchronization see below.
To perform a one-time synchronization with an NTP server, perform the following steps in operational mode.
vyatta@R1:~$ set date ntp 172.16.0.42
Setting the time zone
The time zone must be set by using the system time-zone
command. To set the time zone, you specify the region and location (specified as Region/Location) that best defines your time zone. For example, specifying US/Pacific sets the time zone to US Pacific time. Command completion (that is, the <Tab> key) can be used to list available time zones. The adjustment for daylight time takes place automatically based on the time of year.
The following example shows how to set the time zone to Pacific time.
To set the time zone, perform the following steps in configuration mode.
vyatta@R1# set system time-zone US/Pacific
Using NTP for automatic synchronization
To use NTP for automatic synchronization, you must create associations with the NTP servers. To create an association with an NTP server, use the system ntp server
command and specify the IP address of the server.
The following example shows how to configure two NTP servers: one at 172.16.0.42 and one at 10.10.40.42. To specify NTP servers, perform the following steps in configuration mode.
vyatta@R1# set system ntp server 172.16.0.42
vyatta@R1# set system ntp server 10.10.40.42