Listing 7.8: Reconfiguring zebra.conf through the vtysh Interface junko.foobirds.org# configure terminal junko.foobirds.org(config)# hostname junko junko(config)# log file /var/log/zebra.log junko(config)# interface eth0 junko(config-if)# ip address 172.16.20.3/24 junko(config-if)# multicast junko(config-if)# exit junko(config)# exit junko# write file Configuration saved to /etc/zebra/zebra.conf junko# exit Connection closed by foreign host. [root]# cat /etc/zebra/zebra.conf ! ! Zebra configuration saved from vty ! 2002/05/28 15:22:17 ! hostname junko password Wats?Watt? enable password CHLLlns log file /var/log/zebra.log ! interface lo ! interface eth0 ip address 172.16.20.3/24 multicast ! line vty ! Listing 7.8 picks up where Listing 7.6 ended. We are still in enable mode, and all of the vtysh commands in Listing 7.8, except for the exit commands, can be entered only in enable mode. The configure terminal command tells the system that configuration commands will be entered from the vtysh interface. As each configuration command is entered, vtysh checks it for syntax errors, which is one of the best reasons for entering configuration commands through the vtysh interface. The commands hostname, interface, ip address, and multicast (shown in Listing 7.8) are basic configuration commands found in the zebra.conf file. In fact, all of these commands were discussed earlier when we looked at the zebra.conf example in Listing 7.5. Notice how the vtysh command prompt changes to indicate the different modes of operation. Listing 7.6 shows that the prompt for standard mode, called view mode, is a dollar sign ($), and that the prompt for enable mode is a hash mark (#). When the session enters configuration mode in Listing 7.8, the prompt indicates this with a (config) string. Furthermore, the prompt string changes to indicate what is being configured. For example, the string (config-if)indicates that an interface is being configured. Also notice that each time an exit command is entered, vtysh exits the current mode until the final exit command ends the session. The new configuration is stored in the zebra.conf file by the write file command. The final exit command in Listing 7.8 ends the session that began in Listing 7.6. A cat of the zebra.conf file shows that it has changed substantially from the zebra.conf file that was displayed at the start of Listing 7.6. The original zebra.conf file is not gone, however. vtysh saves the previous configuration file with a .sav extension when it writes the new file. The old zebra.conf file is now stored in /etc/zebra 212
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services