Maintaining clock synchronization is a prerequisite for the stable and reliable operation of a network. For example, in an SDH (Synchronous Digital Hierarchy) network, clock synchronization must be accurately achieved to ensure accurate transmission of data between networks. However, these specifications running at the bottom of the network are too far away for ordinary users. For LAN users, the most commonly used time synchronization operation is "automatically synchronize with the Internet time server"
So what we do in the LAN What is the significance of setting time synchronization? How is it implemented? What are the differences between the settings of the time server in the internal and external networks? Let's explain it in detail with examples of settings in the actual LAN.
1. Problems caused by time synchronization in the local area network
As a network administrator, you must not only ensure the stable operation of network equipment, but also handle failures that may occur at any time in the network in a timely manner. If time synchronization cannot be achieved, it will increase the difficulty of troubleshooting, such as:
(1) Sometimes it is necessary to set the CISCO switch equipment to restart regularly, but the time must be corrected every time before performing this operation. This can ensure the accuracy when executing the reload command. What's more terrible is that after restarting, the switch time returns to the default 1994.
(2) There are dozens of switches in the local area. Although most of them can implement remote network management, due to inconsistent time, it is impossible to prepare the exact time when a network failure occurs.
(3) Recently, the unit has implemented fingerprint machine attendance. Colleagues are also used to checking the time on the computer to fingerprint. However, the time on the computer is always inaccurate, and the result is often that they either go early or go. Late, and when transferring files, inaccurate time information also affects the search results and even causes unnecessary misunderstandings.
So how to achieve time synchronization within the LAN?
2. Time synchronization method
(1) Time synchronization method on the external network (office LAN)
The external network, that is, the office LAN, the network equipment of this LAN can be connected to the Internet, a simplified network topology
The external network uses a CISCO3550 switch as the core switch. Several CISCO 29 series switches are cascaded below, and there are multiple microcomputers in the LAN.
In this network model, we cannot guarantee that every network device can quickly synchronize time with the time server on the Internet (for example, due to problems with the network speed or the time server itself), but it can be guaranteed. It is necessary to have a relatively stable and reliable network quality in the LAN. In this case, we selected CISCO3550 as the time server in the LAN. The CISCO3550 switch has two functions. First, it must synchronize with the time server on the Internet (to ensure (its own clock is accurate), secondly, it must broadcast the clock information within the local area, so that network devices (switches, PCs) in the local area network can synchronize their clocks with it, thereby ensuring clock synchronization within the entire network. Below I Explain the implementation steps respectively.
1. Set up the CISCO3550 switch to synchronize with the time server on the Internet
3550#conf t
Enter configuration commands, one per line. End with CNTL/ Z.
3550(config)#ntp peer 210.72.145.44 (The meaning of peer is that this device can both accept clock synchronization and provide clock to remote devices. Bidirectional 210.72.145.44 is the National Time Service Center of the Chinese Academy of Sciences. IP address)
clock timezone gmt 8 (that is, set to Beijing time zone)
Yes, you only need to type these two simple commands in the CISCO3550 switch. After a while ( The premise is that the CISCO3550 switch can access the Internet), then it can be synchronized with the time server on the Internet. You can use the show clock command to see it intuitively, as shown below:
3550#show clock< /p>
22:18:45.667 gmt Sat May 23 2009
This means that the time of this machine has been synchronized with the time server on the Internet.
Tips
In order to better understand the above two-step settings, there are still some things you need to know
(1) How to get the The address of the time server can be obtained in many ways. First, XP itself comes with two time servers: time.windows.com and time.nist.gov. We only need to perform a ping operation in DOS mode. , you can get their corresponding IP addresses, which are 207.46.232.182 and 192.43.244.18 respectively. Secondly, the Chinese Academy of Sciences has a standard timing server with the address 210.72.145.44. Thirdly, you can check it online and get richer information. For example, when we visit the website www.ntp.org, we can find a bunch of time server addresses, as shown in Table 1:
Area:HostName:
Worldwidepool.ntp. org
Asiaasia.pool.ntp.org
Europeeurope.pool.ntp.org
North Americanorth-america.pool.ntp.org
Oceaniaoceania.pool.ntp.org
South Americasouth-america.pool.ntp.org
Table 1 List of time servers on the Internet
These The servers are all available, and the connection speed to them is also very fast. Among them, pool.ntp.org is highly recommended. As its website name expresses, this is actually an address pool, which can be adjusted in real time according to the actual situation. server address.
2) How to write the domain name directly on the switch
You can directly write the domain name of the time server on the switch, provided that the DNS server has been set up on the switch, as shown below: < /p>
ip name-server 218.56.57.58
ip name-server 219.146.0.130
After setting the DNS server information on the switch, we will execute it on the switch If you ping the URL, you will see that the switch is automatically converting the domain name to the IP address, as shown below:
3550#ping pool.ntp.org
Translating "pool. ntp.org"...domain server (218.56.57.58) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 61.129.66.79, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/145/148 ms
At this time, we have seen that the switch has the ability to automatically convert domain name to IP, and we can directly write the domain name of the time server, as shown below:
3550 (config) #ntp peer pool.ntp.org
(3) How to check NTP information
Use the show clock command to learn the current time information of the switch. There is also a more professional one command, that is "show ntp status", which can list more detailed ntp information of the local machine, as shown below:
3550#show ntp status
Clock is synchronized, stratum 3, reference is 61.129.66.79
nominal freq is 250.0000 Hz, actual freq is 249.9983 Hz, precision is 2**18
reference time is CDC28871.0C1D8818 (22:36 :33.047 gmt Sat May 23 2009)
clock offset is 109.9952 msec, root delay is 328.66 msec
root dispersion is 16010.33 msec, peer dispersion is 15875.03 msec
From the displayed information, we can learn: whether the switch is currently synchronized with the time server (Clock is synchronized), which time server it is synchronized with (reference is 61.129.66.79), and many other useful information.
2. How to make the CISCO3550 switch a time server in the LAN
Now that the clock of the CISCO3550 switch is accurate, how to broadcast the time information in the LAN? ?Perform the following operations:
3550(config)#ntp source vlan 7
3550(config)#inter vlan 7
3550(config- if)#ntp broadcast version 2
Since my unit's CISCO3550 switch has multiple VLANs planned, I chose a VLAN connected to the PIX firewall firewall to broadcast the NTP information. In fact, because the switch Routing between VLANs is enabled (using the ip routing command), and switch PCs in other VLANs can also accept the broadcast information.
3. How to synchronize time between CISCO29 series switches and CISCO3550
CISCO29 series switches can be used as a terminal to synchronize time with a time server. It is very easy to set up time synchronization. You only need to specify the address of the NTP server. Yes, as shown below:
172switch(config)#ntp server 172.19.96.1 (ntp server means that the device updates its own time through the remote clock source, one-way)
172switch(config)#ntp server 192.168.201.2