# Using GRE tunnel

❗️ Can use it just when 2 servers commuticated direcly

## server1

**iptables**

```
-A INPUT -p gre -j ACCEPT
-A RH-Firewall-1-INPUT -i gre-temp -m conntrack --ctstate NEW -j ACCEPT
```

**kernel modules**

```shell
modprobe ip_gre
```

**ip link**

```shell
iptunnel add gre-temp mode gre local $SERVER1_IP remote $SERVER2_IP ttl 225
ip a add 10.10.10.1/30 dev gre-temp
ip link set gre-temp up
```

**temp web-server**

```shell
cd /mnt/$DIR
python -m SimpleHTTPServer
```

## server-2

**kernel modules**

```shell
modprobe ip_gre
```

**ip link**

```shell
iptunnel add gre-temp mode gre remote $SERVER1_IP local $SERVER2_IP ttl 225
ip a add 10.10.10.2/30 dev gre-temp
ip link set gre-temp up
```

Now you can use `wget` for quick transferring date via gre tunnel


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://johnpion.gitbook.io/admin-sky-blog/citrixxenserver/gre.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
