Jump to content
Калькуляторы

Mikrotik GRE + Linux Непонятки в работе

Подскажите в чем может быть проблема, есть микрот с которого строиться GRE на Linux

Микрот

[admin@MikroTik] > interface gre print 
Flags: X - disabled, R - running 
0  R name="gre-tunnel-justhost" 
     mtu=1492 
     actual-mtu=1492 
     local-address=*.*.10.68 
     remote-address=*.*.40.154 
     dscp=inherit 
     clamp-tcp-mss=yes 
     dont-fragment=no 
     allow-fast-path=yes 

 

Linux

[root@v30003 network-scripts]# cat ifcfg-tun0
DEVICE=tun0
BOOTPROTO=none
ONBOOT=yes
TYPE=GRE
TTL=255
MTU=1492

# Адрес сервера
MY_OUTER_IPADDR=*.*.40.154
# Адрес сервера внутри GRE-туннеля
MY_INNER_IPADDR=10.110.10.1

# Адрес пира (удалённой точки)
PEER_OUTER_IPADDR=*.*.10.68
# Адрес пира (удалённой точки) внутри туннеля
PEER_INNER_IPADDR=10.110.10.2

 

В Linux включен NAT

cat /etc/sysctl.conf
net.ipv4.ip_forward = 1

iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE

 

В туннель заворачиваю ya/mail/vk/ok

[admin@MikroTik] > ip firewall address-list print 
Flags: X - disabled, D - dynamic 
#   LIST          ADDRESS                 
0   yandex        5.45.192.0/18 
1   yandex        5.255.192.0/18  
2   yandex        37.9.64.0/18     
3   yandex        37.140.128.0/18   
4   yandex        77.88.0.0/18        
5   yandex        84.201.128.0/18
6   yandex        87.250.224.0/19
7   yandex        93.158.128.0/18
8   yandex        95.108.128.0/17
9   yandex        100.43.64.0/19
10   yandex        130.193.32.0/19
11   yandex        141.8.128.0/18
12   yandex        178.154.128.0/17
13   yandex        199.21.96.0/22
14   yandex        199.36.240.0/22
15   yandex        213.180.192.0/19
16   yandex        93.158.134.0/24
17   yandex        87.250.255.0/24
18   yandex        87.250.254.0/24
19   yandex        87.250.251.0/24
20   yandex        87.250.250.0/24
21   yandex        87.250.247.0/24
22   yandex        77.88.8.0/24
23   yandex        77.88.55.0/24
24   yandex        77.88.54.0/24
25   yandex        77.88.44.0/24
26   yandex        77.88.35.0/24
27   yandex        77.88.21.0/24
28   yandex        77.75.159.0/24
29   yandex        77.75.152.0/22
30   yandex        5.45.240.0/24
31   yandex        5.45.232.0/24
32   yandex        5.45.229.0/24
33   yandex        5.45.217.0/24
34   yandex        5.45.213.0/24
35   yandex        5.45.205.0/24
36   yandex        5.45.196.0/24
37   yandex        5.255.255.0/24
38   yandex        5.255.200.0/24
39   yandex        5.255.196.0/24
40   yandex        5.255.195.0/24
41   yandex        37.9.112.0/24
42   yandex        213.180.204.0/24
43   yandex        213.180.202.0/24
44   yandex        213.180.199.0/24
45   yandex        213.180.193.0/24
46   yandex        185.71.79.0/24
47   yandex        185.71.78.0/24
48   yandex        185.71.77.0/24
49   yandex        185.71.76.0/24
50   yandex        185.71.76.0/22
51   yandex        185.32.186.0/24
52   yandex        185.32.185.0/24
53   yandex        178.154.170.0/24
54   yandex        178.154.131.0/24
55   yandex        109.235.165.0/24
56   yandex        109.235.160.0/21
57   yandex        100.43.87.0/24
58   ok            5.61.16.0/21
59   ok            5.61.232.0/21
60   ok            79.137.157.0/24                     
61   ok            79.137.183.0/24
62   ok            94.100.176.0/20                     
63   ok            95.163.32.0/19                      
64   ok            128.140.168.0/21                    
65   ok            178.22.88.0/21                      
66   ok            178.237.16.0/20                     
67   ok            185.5.136.0/22                      
68   ok            185.6.247.0/24                      
69   ok            185.16.244.0/22                     
70   ok            188.93.56.0/21                      
71   ok            194.186.63.0/24                     
72   ok            195.211.20.0/22                     
73   ok            195.218.168.0/24                    
74   ok            195.218.190.0/23                    
75   ok            217.20.144.0/20                     
76   ok            217.69.128.0/20                     
77   mailru        5.61.16.0/21                        
78   mailru        5.61.232.0/21                       
79   mailru        79.137.157.0/24                     
80   mailru        79.137.183.0/24                     
81   mailru        94.100.176.0/20                     
82   mailru        95.163.32.0/19                      
83   mailru        128.140.168.0/21                    
84   mailru        178.22.88.0/21                      
85   mailru        178.237.16.0/20                     
86   mailru        185.5.136.0/22                      
87   mailru        185.6.247.0/24                      
88   mailru        185.16.244.0/22                     
89   mailru        188.93.56.0/21                      
90   mailru        194.186.63.0/24                     
91   mailru        195.211.20.0/22                     
92   mailru        195.218.168.0/24                    
93   mailru        195.218.190.0/23                    
94   mailru        217.20.144.0/20                     
95   mailru        217.69.128.0/20                     
96   mailru        195.211.21.0/24                     
97   mailru        195.211.22.0/24                     
98   mailru        195.211.20.0/24                     
99   mailru        208.87.94.0/24                      
100   mailru        195.211.130.0/23                    
101   mailru        195.211.128.0/24                    
102   mailru        195.211.128.0/23                    
103   mailru        195.211.128.0/22                    
104   mailru        185.16.244.0/23                     
105   mailru        185.16.148.0/22                     
106   mailru        128.140.170.0/24                    
107   vk            87.240.128.0/18                     
108   vk            93.186.224.0/20                     
109   vk            95.142.192.0/20                     
110   vk            95.213.0.0/17                       
111   vk            185.32.248.0/22                     
112   vk            95.213.0.0/18                       
113   vk            95.142.207.0/24                     
114   vk            95.142.206.0/24                     
115   vk            95.142.204.0/23                     
116   vk            95.142.203.0/24                     
117   vk            95.142.202.0/24                     
118   vk            95.142.201.0/24                     
119   vk            95.142.200.0/21                     
120   vk            95.142.192.0/21                     
121   vk            93.186.232.0/21                     
122   vk            93.186.224.0/21                     
123   vk            185.32.251.0/24                     
124   vk            185.32.250.0/24                     
125   vk            185.32.248.0/23                        

[admin@MikroTik] > ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit 
#      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
0 A S  ;;; VK
       0.0.0.0/0                          gre-tunnel-just...        1
1 A S  ;;; YANDEX
       0.0.0.0/0                          gre-tunnel-just...        1
2 A S  ;;; MAILRU
       0.0.0.0/0                          gre-tunnel-just...        1
3 A S  ;;; OK
       0.0.0.0/0                          gre-tunnel-just...        1
6 ADC  10.110.10.0/24     10.110.10.2     gre-tunnel-just...        0

 

Оно вроде все работает, но бывают вот такие ситуации, когда в ВК грузиться только текст, картинки и музыка не загружается. И смущает вот такая статистика MTR

|------------------------------------------------------------------------------------------|
|                                      WinMTR statistics                                   |
|                       Host              -   %  | Sent | Recv | Best | Avrg | Wrst | Last |
|------------------------------------------------|------|------|------|------|------|------|
|                           gw.home.local -    0 |   43 |   43 |    0 |    0 |    0 |    0 |
|                             10.110.10.1 -    8 |   26 |   24 |   11 |   11 |   13 |   11 |
|                             **.**.40.10 -    8 |   26 |   24 |   14 |   14 |   17 |   17 |
|                            185.131.67.5 -    0 |   43 |   43 |   12 |   13 |   25 |   13 |
|                korova-xe-1-3-0.yndx.net -    0 |   43 |   43 |   13 |   13 |   30 |   14 |
|                     std-p2-be4.yndx.net -    0 |   43 |   43 |   15 |   15 |   17 |   16 |
|            vla1-e2-eth-trunk82.yndx.net -    0 |   43 |   43 |   15 |   15 |   18 |   15 |
|                   No response from host -  100 |    5 |    0 |    0 |    0 |    0 |    0 |
|         vla1-1d4-eth-trunk14-1.yndx.net -    0 |   43 |   43 |   15 |   17 |   29 |   17 |
|                             10.20.34.91 -    3 |   43 |   42 |    0 |   31 |  135 |   23 |
|                               yandex.ru -    0 |   43 |   43 |   21 |   21 |   27 |   21 |
|________________________________________________|______|______|______|______|______|______|
  WinMTR v0.92 GPL V2 by Appnor MSP - Fully Managed Hosting & Cloud Provider

Share this post


Link to post
Share on other sites

ну очевидно же, что надо сделать tcp mss adjust, шлак это умеет делать

Добавил правило

/ip firewall mangle add out-interface=gre-tunnel-justhost protocol=tcp tcp-flags=syn action=change-mss new-mss=1300 chain=forward

Пока что полет нормальный, буду дальше наблюдать

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.