linux gre tunnel
时间: 2024-01-04 07:02:16 浏览: 81
GRE tunnel
4星 · 用户满意度95%
Linux GRE (Generic Routing Encapsulation) tunnel is a method for encapsulating packets from one network protocol within another network protocol. GRE tunnels are used to create a virtual point-to-point link between two networks over an existing IP network.
To set up a GRE tunnel in Linux, you can use the "ip" command. Here is an example command:
```
sudo ip tunnel add gre1 mode gre remote [REMOTE IP] local [LOCAL IP] ttl 255
```
In this command, "gre1" is the name of the GRE tunnel interface, "[REMOTE IP]" is the IP address of the remote endpoint, and "[LOCAL IP]" is the IP address of the local endpoint. The "ttl" option sets the Time-To-Live value for the encapsulated packets.
Once the tunnel is set up, you can configure routing and firewall rules to allow traffic to flow over the tunnel.
阅读全文