> For the complete documentation index, see [llms.txt](https://linkmeup.gitbook.io/sdsm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linkmeup.gitbook.io/sdsm/7.-vpn/3.-gre-over-ipsec/0.-praktika.md).

# Практика

Вернёмся к нашей старой схеме и реализуем на ней именно этот вариант.

![](http://img-fotki.yandex.ru/get/6437/83739833.23/0_abb6a_4785c65b_XL.jpg)

Разумеется, при этом у нас снова появляется туннельный интерфейс (настраивается, как обычный GRE):

```
interface Tunnel0
ip address 10.2.2.1 255.255.255.252
tunnel source 100.0.0.1
tunnel destination 200.0.0.1
```

И далее вы направляете в него нужный вам трафик статическим маршрутом.

```
ip route 10.1.1.0 255.255.255.255 10.2.2.2
```

Что при этом меняется в настройке IPSec?\
В принципе, даже если вы ничего не поменяете, всё уже будет работать, но это не наш путь.\
Во-первых, поскольку туннель уже существует (GRE), нет нужды делать его ещё и средствами IPSec – можно перевести его в транспортный режим, тем самым, сэкономив 20 байтов на лишнем IP-заголовке:

```
crypto ipsec transform-set AES128-SHA esp-aes esp-sha-hmac
mode transport
```

*\*Заметьте, менять, это надо на обеих сторонах, иначе соседство IPSec не установится.*

Во-вторых, шифроваться должен весь трафик между филиалами, то есть тот, который идёт через туннель, соответственно, нет необходимости прописывать все сети в ACL, поступим хитрее:

```
access-list 101 permit gre host 100.0.0.1 host 200.0.0.1
```

Условие выполняется, если на порт пришёл трафик с заголовком GRE и соответствующими адресами.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://linkmeup.gitbook.io/sdsm/7.-vpn/3.-gre-over-ipsec/0.-praktika.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
