In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to use open source software to create SDN on Linux". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Use the open source routing protocol stack Quagga to make your Linux system a router.
Network routing protocols are divided into two categories: internal gateway protocol and external gateway protocol. Routers use the internal gateway protocol to share information within a single autonomous system. If you are using Linux, you can make it behave like a router through the open source (GPLv2) routing protocol stack Quagga.
What is Quagga?
Quagga is a routing package and is a branch of GNU Zebra. It provides the implementation of all the mainstream routing protocols for Unix-like platforms, such as Open shortest path first (OSPF), routing Information Protocol (RIP), Border Gateway Protocol (BGP) and Intermediate system to Intermediate system Protocol (IS-IS).
Although Quagga implements the routing protocols of IPv4 and IPv6, it is not a complete router. A real router not only implements all routing protocols, but also has the ability to forward network traffic. Quagga only implements the routing protocol stack, while forwarding network traffic is handled by the Linux kernel.
Architecture
Quagga implements different routing protocols through daemons for specific protocols. The daemon name is the same as the routing protocol, with the letter "d" as the suffix. Zebra is the core and protocol-independent daemon that provides an abstraction layer for the kernel and provides Zserv API to Quagga clients through TCP sockets. The daemon for each specific protocol is responsible for running the relevant protocol and establishing a routing table based on the information exchanged.
Quagga architecture
Environment
This tutorial uses the OSPF protocol implemented by Quagga to configure dynamic routing. The environment includes two CentOS 7.7hosts named Alpha and Beta. The two hosts share access to the 192.168.122.0 Universe 24 network.
Host Alpha:
IP:192.168.122.100/24 Gateway: 192.168.122.1
Host Beta:
IP:192.168.122.50/24 Gateway: 192.168.122.1
Install the package
First, install the Quagga package on both hosts. It exists in the CentOS base repository:
Yum install quagga-y enables IP forwarding
Next, enable IP forwarding on both hosts, as it will be performed by the Linux kernel:
Sysctl-w net.ipv4.ip_forward = 1sysctl-p configuration
Now, go to the / etc/quagga directory and create a configuration file for your settings. You need three files:
Configuration file for the zebra.conf:Quagga daemon, where you can define the interface and its IP address and IP forwarding
Ospfd.conf: protocol configuration file in which you can define the network to be provided through the OSPF protocol
Daemons: where you will specify the relevant protocol daemons to run
On the host Alpha
[root@alpha] # cat / etc/quagga/zebra.confinterface eth0 ip address 192.168.122.100 area 0.0.0.0line vty 24 ipv6 nd suppress-rainterface eth2 ip address 10.12.13.1 etc/quagga/ospfd.confinterface eth0interface eth2interface lorouter ospf network 24 ipv6 nd suppress-rainterface loip forwardingline vty [root@alpha] # cat / etc/quagga/ospfd.confinterface eth0interface eth2interface lorouter ospf network 192.168.122.0 network 24 area 0.0.0.0line vty [root@alphaa ~] # cat / etc/quagga/daemonszebra=yesospfd=yes
On the host Beta
[root@beta quagga] # cat zebra.confinterface eth0 ip address 192.168.122.50 network 24 ipv6 nd suppress-rainterface eth2 ip address 10.10.10.1 cat 24 ipv6 nd suppress-rainterface loip forwardingline vty [root@beta quagga] # cat ospfd.confinterface eth0interface eth2interface lorouter ospf network 192.168.122.0 network 24 area 0.0.0.0 network 10.10.10.0 Universe 24 area 0.0.0.0line vty [root@beta ~] # cat / etc/quagga/daemonszebra=yesospfd=yes configuration Firewall
To use the OSPF protocol, you must allow it to pass through the firewall:
Firewall-cmd-add-protocol=ospf-permanent firewall-cmd-reload
Now, start the zebra and ospfd daemons.
# systemctl start zebra# systemctl start ospfd
View the routing table on both hosts with the following command:
[root@alpha ~] # ip route show default via 192.168.122.1 dev eth0 proto static metric 10010.10.10.10.10.10.10.10.10 metric 24 via 192.168.122.50 dev eth0 proto zebra metric 2010.12.13.0 metric 10.12.13.1192.168.122.0 metric 24 dev eth0 proto kernel scope link src
You can see that the routing table on Alpha contains the routing entries from 192.168.122.50 to 10.10.10.Uniple 24, which are obtained through the protocol zebra. Similarly, on the host Beta, the table contains the route entries that reach network 10.12.13.0 take 24 through 192.168.122.100.
[root@beta ~] # ip route showdefault via 192.168.122.1 dev eth0 proto static metric 10010.10.10.10.10.10.10.10.10.10.12.13.0 metric 24 via 192.168.122.100 dev eth0 proto zebra metric 20192.168.122.0 metric 100 conclusion
As you can see, the environment and configuration are relatively simple. To add complexity, you can add more network interfaces to the router to provide routing for more networks. You can also use the same method to implement BGP and RIP protocols.
This is the end of "how to use open source software to create SDN on Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.