Create a vro in Linux

Source: Internet
Author: User

For Network Interconnection engineers, it is very important to establish an Internet dynamic route. This requires not only understanding the concept of routing, but also how to put it into practice. Currently, network devices are provided by large companies such as Cisco. Most independent routing developers are often restricted by the school or laboratory environment and cannot make full use of existing resources. Using Cisco technology equipment to build a network requires a lot of costs. To break this situation, we use a small experimental network, using the routing information protocol RIP) and Open Shortest Path First OSPF) to demonstrate their different load balancing solutions.
One of the three routers we use is simulated using Linux technology. Initially, we tried to use traditional routes and select non-interactive backend programs to build a test network, but soon we found that this method is very complex and has limited functions. Finally, we decided to find a more advanced method to build a test network. Fortunately, we found Zebra.
What is Zebra?
Zebra is a TCP/IP routing software that supports BGP-4, BGP-4 +, OSPFv2, OSPFv3, r1_1, r1_2, and RIPng. It complies with the gnu gpl standard and can run on Linux and other Unix variant systems. Zebra is one of the most advanced routing software. The latest version can be downloaded from the GUN Zebra Web site.
The earliest Zebra kit was developed by Kunihiro Ishiguro and Yoshinari Yoshikawa in 1996. Currently, the Zebra suite is maintained by IP Infusion, and Ishiguro, one of the founders of the software, is the CTO of the company.
Zebra can use the module method to manage various protocols. This design is unique. It can activate or stop the protocol based on network requirements. So far, we have found that the most useful part of Zebra is that it is very similar to the Cisco IOS setting format. Although there are some differences between it and IOS, network engineers familiar With IOS will soon adapt to the Zebra network environment. Currently, Zebra 1.0 has not been released. The latest version is Zebra 0.93b, which is sufficient for a small network.
Installation of Zebra
We chose ThinkPad X20 with stable performance as Zebra's hardware testing platform, and Red Hat Linux 9 as its software testing platform. ThinkPad X20 has a built-in Ethernet interface. To enable it to act as a router, we have added a PCMCIA Ethernet Card for it. Before installing Zebra, make sure that all NICs are recognized by the Linux system.
Red Hat 9 has integrated the RPM of Zebra 0.93b. You can also download the Zebra software from the Internet. For convenience, we decided to install Zebra 0.93b RPM. The Installation Process of Zebra RPM is basically the same as that of other software. The installed items include binary setting commands, small programs, configuration files, required project menus, instances, and documents.
Basic settings of Zebra
Zebra has no background interaction program, which is a real route management program. It controls other software modules and provides master ports for interaction with customers. The Zebra RPM kit contains a complete reference setting file. However, you only need to create a/etc/zebra. conf file that includes the following content to set Zebra.
The simplest Zebra setting file:

     
      hostname speedmetalpassword zebraenable password zebra
     

Whenever you enter the interactive setting mode, the Hostname command specifies the name of the vro. This name can be set at will, and may not match the host name. The Password command determines the logon Password of the interactive Zebra terminal.
After/etc/zebra. conf is created, run the following command to start the zebra non-Background interaction program:
      
       # service zebra start
      

Now we can enter the Zebra Interactive dialog mode by connecting to port 2601 of the machine.
Zebra dialog mode instance:
      
       [root@speedmetal zebra]# telnet 127.0.0.1 2601Trying 127.0.0.1...Connected to 127.0.0.1.Escape character is '^]'.Hello, this is zebra (version 0.93b).Copyright 1996-2002 Kunihiro Ishiguro.User Access VerificationPassword: zebraspeedmetal> enablePassword: zebraspeedmetal# ?  configure  Configuration from vty interface  copy       Copy configuration  debug      Debugging functions (see also 'undebug')  disable    Turn off privileged mode command  end        End current mode and change to enable mode.  exit       Exit current mode and down to previous mode  help       Description of the interactive help system  list       Print command list  no         Negate a command or set its defaults  quit       Exit current mode and down to previous mode  show       Show running system information  terminal   Set terminal line parameters  who        Display who is on vty  write      Write running configuration to memory, network, or terminalspeedmetal#
      


We can easily understand this, because we can click on the screen? Key to understand the meaning of a command at any time. If you have experience configuring a Cisco router, I believe this setting process is no stranger.
So far, we have only completed the setting and running of Zebra, and the setting of various protocols has not started yet. If you are ready, let's continue.

Set and use MRLG
MRLGMulti-Router Looking Glass) is a network-based tool written by John fraier of EnterZone. It can be used to display interfaces and paths that can be recognized by Zebra. MRLG is actually a Web interface of the command line processing program specified by Zebra, which consists of limited commands. However, during the test, we found that the path can be quickly displayed. This is very important for network protocols. Therefore, you must install MRLG before setting the protocols.
MRLG requires the Net: Telnet Per suite to communicate with the command line handler specified by Zebra. Unfortunately, we cannot find Net: Telnet Per suite in Red Hat 9, so we only download it online.
As MRLG runs as a CGI application, we also need to install a network server software. You can use httpd rpm integrated in Red Hat 9.
We will/usr/share/doc/zebra-0.93b/tools in mrlg. copy the cgi File to/var/www/cgi-bin, and then copy. modify line 36th of cgi from $ url = "http://www.sample.com/mrlg.cgi"; to $ url = http: // 127.0.0.1/cgi-bin/mrlg. cgi. In addition, we need to modify the command blocks between lines 168 and 174. The modified command blocks are as follows:

     
      if ($Form{'router'} eq 'router1')        {$server = '127.0.0.1';$login_pass = 'zebra';$bgpd = "2605";$zebra = "2601";$full_tables=1;
     

Finally, to connect to MRLG, enter http: // 127.0.0.1/cgi-bin/mrlg. cgi. in the address bar of the browser, as shown in result 1.


Figure 1 connect to MRLG and enter the address to display


Lab Configuration
Our lab configuration includes two Cisco 3620 routers and one ThinkPad X20. In addition to the built-in Ethernet port, ThinkPad X20 also has a Home-and-Away PCMCIA ethernet card. The communication between two Cisco 3620 routers is mainly achieved through serial port connections. The connection between them and ThinkPad X20 is achieved through Ethernet, as shown in figure 2 of the overall architecture.


Figure 2 overall architecture
Use Zebra to set Network Ports
We use the Zebra software to manage the network first by using RIP. As mentioned above, we have installed Zebra on ThinkPad. Because we need to establish another network interface on ThinkPad, we must first set a virtual network device, such:
       
        # modprobe dummy# ifconfig dummy0
       

Next, we can connect to the Zebra program port to start setting. Our conversation with Zebra should be conducted in the following order.
Port setting sequence:
       
        User Access VerificationPassword: zebraspeedmetal> enablePassword: zebraspeedmetal# configure terminalspeedmetal(config)# interface eth0speedmetal(config-if)# ip address 192.168.2.1/30speedmetal(config-if)# quitspeedmetal(config)# interface eth1speedmetal(config-if)# ip address 192.168.1.1/30speedmetal(config-if)# quitspeedmetal(config)# interface dummy0speedmetal(config-if)# ip address 10.0.2.1/24speedmetal(config-if)# writeConfiguration saved to /etc/zebra/zebra.confspeedmetal(config-if)# endspeedmetal# show runCurrent configuration:!hostname speedmetalpassword zebraenable password zebra!interface lo!interface eth0 ip address 192.168.2.1/30!interface dummy0 ip address 10.0.2.1/24!interface eth1 ip address 192.168.1.1/30!!line vty!end
       

Note: We didn't set IP addresses on ThinkPad as usual, but set them through Zebra. These settings are stored in the/etc/zebra. conf file. Therefore, these settings are activated whenever the Zebra service starts.
The main content of the zebra. conf file is as follows:
/Etc/zebra. conf file content
       
        !! Zebra configuration saved from vty!   2003/08/20 00:07:51!hostname speedmetalpassword zebraenable password zebra!interface lo!interface eth0 ip address 192.168.2.1/30!interface dummy0 ip address 10.0.2.1/24!interface eth1 ip address 192.168.1.1/30!!line vty!
       

You can also use MRLG to view the status of each network port. The specific step is to select the default status "router1", then select the "show interface" button, and click "Execute ".
Use Zebra to set RIP Route Selection
Because we have set the network port on the ThinkPad router, We can configure the router to synchronize it with RIP. Zebra uses different non-Background interactive programs to support different routing protocols. Therefore, we must first create a simple setup file/etc/zebra/ripd. conf.
Basic/etc/zebra/ripd. conf file:
       
        hostname speedmetal-rippassword zebraenable password zebra
       

Run ripd without background interaction program:
       
        # service ripd start
       

Then, we can connect to the 2602 interface of the Zebra router to set the RIP without background interaction program.
RIP settings:
       
        User Access VerificationPassword: zebraspeedmetal-rip> enablePassword: zebraspeedmetal-rip# configure terminalspeedmetal-rip(config)# router ripspeedmetal-rip(config-router)# network 10.0.0.0/8speedmetal-rip(config-router)# network 192.168.0.0/16speedmetal-rip(config-router)# endspeedmetal-rip# show runCurrent configuration:!hostname speedmetal-rippassword zebraenable password zebra!interface lo!interface eth0!interface dummy0!router rip network 0.0.0.0/0 network 192.168.0.0/16!line vty!endspeedmetal-rip# writeConfiguration saved to /etc/zebra/ripd.confspeedmetal-rip#
       

The/etc/zebra/ripd. conf file after setting is:
       
        !! Zebra configuration saved from vty!   2003/08/19 13:50:30!hostname speedmetal-rippassword zebraenable password zebra!interface lo!interface eth0!interface eth1!interface dummy0!router rip network 10.0.0.0/8 network 192.168.0.0/16!line vty!
       

Create a RIP Route Selection on a Cisco Router
To make the settings of the two Cisco 3620 routers easier, we name them "A" and "B". Here we only make the most basic settings so that they can work properly. These settings include setting the port IP address, the return address, and the serial clock frequency used for normal serial communication.
Configure vroa:
       
        Router#config terminalRouter(config)#hostname RouterARouterA(config)#int s0/0RouterA(config-if)#ip address 192.168.0.1 255.255.255.252RouterA(config-if)#no shutRouterA(config-if)# interface fastEthernet 0/0RouterA(config-if)#ip address 192.168.2.2 255.255.255.252RouterA(config-if)#no shutRouterA(config-if)#int loopback 0RouterA(config-if)#ip address 10.0.0.1 255.255.255.0RouterA(config-if)#endRouterA#write
       

You can set vrob B in the same way:
       
        Router#configure terminalRouter(config)#hostname RouterBRouterB(config)#int s0/0RouterB(config-if)#ip address 192.168.0.2 255.255.255.252RouterB(config-if)#no shutRouterB(config-if)#int fastEthernet0/0RouterB(config-if)#ip address 192.168.1.2 255.255.255.252RouterB(config-if)#no shutRouterB(config-if)#int loopback 0RouterB(config-if)#ip address 10.0.1.1 255.255.255.0RouterB(config-router)#endRouterB#write
       

Setting RIP on vrouters 3620 is similar to setting commands in Zebra. We connect two 3620 routers through the control line and execute the following commands.
Set RIP for router:
       
        RouterA#conf tEnter configuration commands, one per line. End with CNTL/Z.RouterA(config)#router ripRouterA(config-router)#network 10.0.0.0RouterA(config-router)#network 192.168.0.0RouterA(config-router)#network 192.168.2.0RouterA(config-router)#version 2RouterA(config-router)#endRouterA#write
       

Set RIP for router B:
       
        RouterB#conf tEnter configuration commands, one per line. End with CNTL/Z.RouterB(config)#router ripRouterB(config-router)#network 10.0.1.0RouterB(config-router)#network 192.168.0.0RouterB(config-router)#network 192.168.1.0RouterB(config-router)#version 2RouterB(config-router)#endRouterB#write
       

The rip command of the router is mainly used to activate the RIP process. This network command informs the router of the network to which RIP will spread.
Use RIP to expand the path
Now that we have completed the configuration of the Cisco router and Zebra software, we can check the paths that are being expanded. In the MRLG status, select "show ip route" and click "Execute" to obtain some reports.
Use the RIP path displayed by Zebra:
       
        Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,       B - BGP, > - selected route, * - FIB routeR>* 10.0.0.0/24 [120/2] via 192.168.2.2, eth0, 00:11:05R>* 10.0.1.0/24 [120/2] via 192.168.1.2, eth1, 00:02:08C>* 10.0.2.0/24 is directly connected, dummy0K * 127.0.0.0/8 is directly connected, loC>* 127.0.0.0/8 is directly connected, loR>* 192.168.0.0/30 [120/2] via 192.168.2.2, eth0, 00:11:05C>* 192.168.1.0/30 is directly connected, eth1C>* 192.168.2.0/30 is directly connected, eth0
       

Paths with the R Mark are obtained through RIP.
Zebra now recognizes two networks 10.0.0.0/24 and 10.0.1.0/24 Based on vroa A and vrob B. We can run ping 10.0.0.1 and ping 10.0.1.1 on ThinkPad to check network connectivity.
In order to check the countermeasures for network faults, we disconnected the network connecting to router A. After about two minutes, Zebra began to connect to the 10.0.0.0/24 network through router B bypass. We will explain in the next section.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.