In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the deployment method of GRE in Linux environment". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "what is the deployment method of GRE in Linux environment" together.
GRE (Windows does not support) GRE Introduction
Generic Routing Encapsulation (GRE) is a protocol that encapsulates data packets of certain network layer protocols (such as IP and IPX) so that these encapsulated data packets can be transmitted in another network layer protocol (such as IP). GRE uses Tunnel technology, which is the third layer tunnel protocol of V_P_N (Virtual Private Network).
Advantages of GRE
The GRE implementation mechanism is simple and the burden on the equipment at both ends of the tunnel is small.
GRE tunnel can connect local networks of various network protocols through IPv4 network, effectively utilizing the original network architecture and reducing costs.
GRE tunneling extends the scope of work of hop-limited network protocols and enables enterprises to flexibly design network topologies.
GRE tunnel can encapsulate multicast data, and when combined with IPSec, it can ensure the security of multicast services such as voice and video.
GRE tunnel supports enabling MPLS LDP, uses GRE tunnel to carry MPLS LDP packet, establishes LDP LSP, and realizes interworking of MPLS backbone network.
GRE tunnels connect discontiguous subnets and are used to form V_P_N to achieve secure connections between corporate headquarters and branches.
Experiment:
Use GRE to build a simple v_p_n, which can be accessed normally using the client (Windows does not support GRE, so use two Linux hosts)
experimental topology
Host Name IP Address clienteth4 201.1.2.10proxyeth0 192.168.19.130
eth4 201.1.2.5
Step 1: Enable the GRE module (both client and proxy)
1) View the modules currently loaded on your computer
lsmod #Display module list lsmod| grep ip_gre #Determine if the gre module is loaded
2) Load module ip_gre
modprobe ip_gre
3)View module information
info moduip_gre# /lib/modules/4.18.0-240.el8.x86_64/kernel All Linux modules are here #find / -name "*.ko*"| wc -l#2501#There are 2501 built-in modules in our Linux system, and my Linux system is Redhat8.3#rmmod module name Close module
Step 2: Client creates V_P_N tunnel
1) Creating a tunnel
ip tunnel add tun0 mode gre remote 201.1.2.5 local 201.1.2.10#ip tunnel add Create a tunnel (tunnel name is tun0), ip tunnel help You can view help #mode Set tunnel mode #local followed by the IP address of the host, remote followed by the IP of the tunnel with other hosts
2) Enable the tunnel (similar to network card startup)
ip a s #View all NIC information of this machine Generally, the tunnel added is the last one, and it is closed by default ip link showip link set tun0 up #Enable tunnel ip link show
3) Configure tunnel IP address for V_P_N
ip a sip addr add 10.10.10.10/24 peer 10.10.10.5/24 dev tun0 #Set local ip for tunnel tun0 (10.10.10/24)#Tunnel IP of host ip opposite tunnel is (10.10.10.5/24) ip a s #Check whether IP is added successfully
4) Close the firewall
systemctl stop firewall Step 3: proxy host creates V_P_N tunnel
1) View the modules currently loaded on the computer and load them
lsmod #Display module list lsmod| grep ip_gre #Determine if gre module modprobe ip_gre is loaded
2) Creating a tunnel
ip tunnel add tun0 mode gre remote 201.1.2.10 local 201.1.2.5
3) Enable the tunnel (similar to network card startup)
ip link set tun0 up #Enable tunneling ip link show
4) Configure tunnel IP address for VPN
ip addr add 10.10.10.5/24 peer 10.10.10.10/24 dev tun0ip a s
5)turn off the firewall
systemctl stop firewalld
6) Enable routing forwarding (soft routing)
echo "1" > /proc/sys/net/ipv4/ip_forward#1 Turn on route forwarding #0 Turn off route forwarding #After route forwarding is turned on, others can access other things by accessing this server and forwarding through the server Step 4: Start the test
Thank you for reading, the above is the content of "what is the deployment method of GRE in Linux environment", after learning this article, I believe everyone has a deeper understanding of what is the deployment method of GRE in Linux environment, and the specific use situation needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.