{"id":53572,"date":"2019-12-05T00:00:00","date_gmt":"2019-12-04T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya"},"modified":"2020-02-18T14:01:29","modified_gmt":"2020-02-18T11:01:29","slug":"chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya","title":{"rendered":"What happens during connections inside and outside the VPN tunnel","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Letters to Tucha's technical support often turn into real articles. Recently, a client reached out to us asking to clarify what happens with connections within the VPN tunnel between the user's office and the cloud environment, as well as with connections outside the VPN tunnel. Therefore, the text provided below is an actual letter we sent to one of the clients in response to their question. Of course, we changed the IP addresses to anonymize the client. But yes, Tucha's technical support is indeed renowned for its detailed responses and informative letters. \ud83d\ude42<\/p>\n<p>Of course, we understand that for many, this article may not be groundbreaking. However, since articles for beginner administrators occasionally appear on Habr, and given that this article originated from a real letter to a real client, we still want to share this information here. There's a good chance it will be useful to someone. <br \/>\nSo, we will explain in detail what happens between the cloud server and the office if they are connected via a site-to-site network. Note that some services are only available from the office, while others can be accessed from anywhere on the Internet.<\/p>\n<p>First, we will clarify that our client requested the server <b>192.168.A.1<\/b> to allow connections via RDP from anywhere, connecting to <b>A.A.A.2:13389<\/b>, while the other services are accessible only from the office <b>(192.168.B.0\/24)<\/b>, connected through <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/vpn\/\"   title=\"VPN\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"85\">VPN<\/a>. The client also initially set it up so that the machine <b>192.168.B.2 <\/b>in the office could also be accessed via RDP from anywhere, connecting to <b>B.B.B.1:11111<\/b>. We assisted in organizing IPSec connections between the cloud and the office, and the client's IT specialist began to ask questions about what would happen in various scenarios. To answer all these questions, we wrote out everything you can read below.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\n<img decoding=\"async\" alt=\"What happens during connections inside and outside the VPN tunnel\" src=\"\/wp-content\/uploads\/2019\/12\/7ee4e6c8fd9b122b092e7f8d99bb0235.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p>Now, let's examine these processes in more detail.<\/p>\n<p><\/p>\n<h3>Position One<\/h3>\n<p>\nWhen something is sent from <b>192.168.B.0\/24<\/b> downward API support (simultaneously with this in <b>192.168.A.0\/24<\/b> or from <b>192.168.A.0\/24<\/b> downward API support (simultaneously with this in <b>192.168.B.0\/24<\/b>, it enters the VPN. This means that the packet is additionally encrypted and transmitted between <b>B.B.B.1<\/b> and <b>A.A.A.1<\/b>, but <b>192.168.A.1<\/b> sees the packet specifically from <b>192.168.B.1<\/b>. They can communicate with each other using any protocols. The responses are sent back through the VPN in the same way, thus the packet from <b>192.168.A.1<\/b> for <b>192.168.B.1<\/b> will be sent as an ESP datagram from <b>A.A.A.1<\/b> to <b>B.B.B.1<\/b>, which the router on the other side will unwrap, extract the packet from, and deliver to <b>192.168.B.1<\/b> how a packet from <b>192.168.A.1<\/b>.<\/p>\n<p>A specific example:<\/p>\n<p>1) <b>192.168.B.1<\/b> calls <b>192.168.A.1<\/b>, wants to establish a TCP connection with <b>192.168.A.1:3389<\/b>;<\/p>\n<p>2) <b>192.168.B.1<\/b> sends a request to establish a connection from <b>192.168.B.1:55555<\/b> (the port number for feedback is chosen by it, here and thereafter we will use number 55555 as an example of such a port number that the system selects during the formation of the TCP connection) to <b>192.168.A.1:3389<\/b>;<\/p>\n<p>3) the operating system running on the computer with the address <b>192.168.B.1<\/b>, decides to send this packet to the gateway address of the router (<b>192.168.B.254<\/b> in our case), because it does not have other, more specific routes for <b>192.168.A.1<\/b>, so it sends the packet via the default route (0.0.0.0\/0);<\/p>\n<p>4) for this, it tries to find the MAC address for the IP address <b>192.168.B.254 <\/b>in the ARP protocol cache table. If not found, it sends from the address <b>192.168.B.1<\/b> a broadcast who-has request to the network <b>192.168.B.0\/24<\/b>When <b>192.168.B.254<\/b> responds by sending its MAC address, the system sends the Ethernet packet to it and records this information in its cache table;<\/p>\n<p>5) the router receives this packet and determines where to send it: it has a policy that states it must route all packets between <b>192.168.B.0\/24<\/b> and <b>192.168.A.0\/24<\/b> over a VPN connection between <b>B.B.B.1<\/b> and <b>A.A.A.1<\/b>;<\/p>\n<p>6) the router forms an ESP datagram from <b>B.B.B.1<\/b> to <b>A.A.A.1<\/b>;<\/p>\n<p>7) the router decides where to send this packet, it sends it to, for example, <b>B.B.B.254<\/b> (ISP gateway), because it does not have more specific routes to <b>A.A.A.1<\/b>, than 0.0.0.0\/0;<\/p>\n<p>8) just like mentioned before, it finds the MAC address for <b>B.B.B.254<\/b> and sends the packet to the ISP gateway;<\/p>\n<p>9) ISPs transmit the ESP datagram through their networks from <b>B.B.B.1<\/b> to <b>A.A.A.1<\/b>;<\/p>\n<p>10) the virtual router at <b>A.A.A.1<\/b> receives this datagram, decrypts it, and obtains the packet from <b>192.168.B.1:55555<\/b> for <b>192.168.A.1:3389<\/b>;<\/p>\n<p>11) the virtual router checks where to send it, finds the network in the routing table <b>192.168.A.0\/24<\/b> and sends it directly to <b>192.168.A.1<\/b>, since it has an interface <b>192.168.A.254\/24<\/b>;<\/p>\n<p>12) for this, the virtual router finds the MAC address for <b>192.168.A.1<\/b> and sends this packet to it over a virtual Ethernet network;<\/p>\n<p>13) <b>192.168.A.1<\/b> receives this packet on port 3389, agrees to establish a connection and forms a response packet from <b>192.168.A.1:3389<\/b> to <b>192.168.B.1:55555<\/b>;<\/p>\n<p>14) its system sends this packet to the gateway address of the virtual router (<b>192.168.A.254<\/b> in our case), because it does not have other, more specific routes for <b>192.168.B.1<\/b>, it does not have, so it must send the packet via the default route (0.0.0.0\/0);<\/p>\n<p>15) just as in the previous cases, the system running on the server with the address <b>192.168.A.1<\/b>, finds the MAC address <b>192.168.A.254<\/b>, since it is in the same network as its interface <b>192.168.A.1\/24<\/b>;<\/p>\n<p>16) the virtual router receives this packet and decides where to forward it: it has a policy that dictates it must process all packets between <b>192.168.A.0\/24<\/b> and <b>192.168.B.0\/24<\/b> over a VPN connection between <b>A.A.A.1<\/b> and <b>B.B.B.1<\/b>;<\/p>\n<p>17) the virtual router creates an ESP datagram from <b>A.A.A.1<\/b> for <b>B.B.B.1<\/b>;<\/p>\n<p>18) the virtual router decides whom to send this packet to, forwarding it to <b>A.A.A.254<\/b> (the internet service provider's gateway, which, in this case, is also us), because there are no more specific routes to <b>B.B.B.1<\/b>, than 0.0.0.0\/0;<\/p>\n<p>19) internet providers transmit the ESP datagram across their networks <b>A.A.A.1<\/b> to <b>B.B.B.1<\/b>;<\/p>\n<p>20) the router at <b>B.B.B.1 <\/b>receives this datagram, decrypts it, and obtains the packet from <b>192.168.A.1:3389<\/b> for <b>192.168.B.1:55555<\/b>;<\/p>\n<p>21) it understands that it should forward it specifically to <b>192.168.B.1<\/b>, since it is in the same network, therefore, there is a corresponding entry in the routing table that compels it to send packets for all <b>192.168.B.0\/24<\/b> directly;<\/p>\n<p>22) the router finds the MAC address for <b>192.168.B.1<\/b> and forwards this packet to it;<\/p>\n<p>23) the operating system on the computer with the address <b>192.168.B.1<\/b> receives the packet from <b>192.168.A.1:3389<\/b> for <b>192.168.B.1:55555<\/b> and initiates the next steps to establish a TCP connection.<\/p>\n<p>This example concisely and simply describes what happens at layers 2-4 (many more details could be recalled here). Layers 1, 5-7 are not covered.<\/p>\n<h3>Position two<\/h3>\n<p>\nIf something is sent specifically to <b>192.168.B.0\/24<\/b> A.A.A.2 <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>, this packet is NAT-ed from address <b>192.168.B.1<\/b> calls <b>A.A.A.2:13389<\/b>, passing to <b>B.B.B.1<\/b>, and there the router receives it and forwards it to <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>knows nothing about <b>192.168.A.1<\/b>. <b>192.168.A.1<\/b> , it sees the packet from <b>192.168.B.1<\/b>, since it is NAT-ed. Therefore, the response to this request goes through the common route, it is NAT-ed from address<b> B.B.B.1<\/b>and heads to <b>, it goes not through the VPN, but directly. This means that if a user from address <\/b>, and that router returns this response to <b>B.B.B.1<\/b>, which sees the response from <b>192.168.B.1<\/b>, the one it was addressing. <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>(this number, just like in the previous example, may be different) at<\/p>\n<p>A specific example:<\/p>\n<p>1) <b>192.168.B.1<\/b> calls <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>, wants to establish a TCP connection with <b>A.A.A.2:13389<\/b>;<\/p>\n<p>2) <b>192.168.B.1<\/b> sends a request to establish a connection from <b>192.168.B.1:55555<\/b> , it does not exist, which means it forwards the packet via the default route (0.0.0.0\/0); <b>A.A.A.2:13389<\/b>;<\/p>\n<p>3) the operating system running on the computer with the address <b>192.168.B.1<\/b>, decides to send this packet to the gateway address of the router (<b>192.168.B.254<\/b> in our case), because it does not have other, more specific routes for <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>4) for this, as we mentioned in the previous example, it tries to find the MAC address for the IP address<\/p>\n<p>5) the router receives this packet and decides where to forward it: it has a policy that dictates it must NAT (substituting the source address) all packets from <b>192.168.B.254<\/b> in the ARP protocol cache table. If not found, it sends from the address <b>192.168.B.1<\/b> a broadcast who-has request to the network <b>192.168.B.0\/24<\/b>When <b>192.168.B.254<\/b> responds by sending its MAC address, the system sends the Ethernet packet to it and records this information in its cache table;<\/p>\n<p>to other nodes in the internet; <b>192.168.B.0\/24<\/b> to other nodes of the Internet;<\/p>\n<p>6) Since this policy implies that the return address must match the lower address on the interface through which this packet will be sent, the router first determines to whom exactly it should send this packet, as in the previous example, it must send it to <b>B.B.B.254<\/b> (ISP gateway), because it does not have more specific routes to <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>, than 0.0.0.0\/0;<\/p>\n<p>7) Therefore, the router replaces the return address of the packet, from now on the packet from <b>B.B.B.1:44444<\/b> (the port number, of course, can be different) to <b>A.A.A.2:13389<\/b>;<\/p>\n<p>8) The router remembers what it did, so when the response from <b>A.A.A.2:13389<\/b> to <b>B.B.B.1:44444<\/b> comes in, it will know that it should change the address and port of the recipient to <b>192.168.B.1:55555<\/b>.<\/p>\n<p>9) Now, the router must send it to the internet service provider through<b> B.B.B.254<\/b>, therefore, just as we mentioned earlier, it finds the MAC address for <b>B.B.B.254 <\/b>and sends the packet to the ISP gateway;<\/p>\n<p>10) Internet service providers transmit the packet through their networks from <b>B.B.B.1<\/b> to <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>;<\/p>\n<p>11) The virtual router at <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b> receives this packet on port 13389;<\/p>\n<p>12) The virtual router has a rule that stipulates that packets received from any sender on this port should be sent to <b>192.168.A.1:3389<\/b>;<\/p>\n<p>13) The virtual router finds the network in the routing table <b>192.168.A.0\/24<\/b> and sends it directly to <b>192.168.A.<\/b>1, as it has the interface<b> 192.168.A.254\/24<\/b>;<\/p>\n<p>14) For this, the virtual router finds the MAC address for<b> 192.168.A.1<\/b> and sends this packet to it over a virtual Ethernet network;<\/p>\n<p>15) <b>192.168.A.1<\/b> receives this packet on port 3389, agrees to establish a connection and forms a response packet from <b>192.168.A.1:3389<\/b> to<b> B.B.B.1:44444<\/b>;<\/p>\n<p>16) Its system forwards this packet to the gateway address of the virtual router (<b>192.168.A.254<\/b> in our case), because it does not have other, more specific routes for <b>B.B.B.1<\/b>, it does not have, so it must send the packet via the default route (0.0.0.0\/0);<\/p>\n<p>17) Just like in the previous cases, the system running on the server with the address <b>192.168.A.1<\/b>, finds the MAC address <b>192.168.A.254<\/b>, since it is in the same network as its interface <b>192.168.A.1\/24<\/b>;<\/p>\n<p>18) The virtual router receives this packet. It should be noted that it remembers having received the packet from <b>A.A.A.2:13389<\/b> and changed its address and recipient port to <b>B.B.B.1:44444<\/b> , therefore, for the packet from <b>192.168.A.1:3389<\/b>it changes the sender's address to<b> 192.168.A.1:3389 <\/b>for <b>B.B.B.1:44444<\/b> 19) The virtual router decides to whom to send this packet, it sends it to <b>A.A.A.2:13389<\/b>;<\/p>\n<p>20) Internet service providers transmit the packet with <b>A.A.A.254<\/b> (the internet service provider's gateway, which, in this case, is also us), because there are no more specific routes to <b>B.B.B.1<\/b>, than 0.0.0.0\/0;<\/p>\n<p>21) The router at <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b> to <b>B.B.B.1<\/b>;<\/p>\n<p>receives this packet and recalls that when it forwarded the packet from <b>B.B.B.1<\/b> , it changed its sender address and port to <b>192.168.B.1:55555<\/b> for <b>A.A.A.2:13389<\/b>, so this is a response that needs to be sent to <b>B.B.B.1:44444<\/b>(In reality, there are several more checks, but we will not delve into that); <b>192.168.B.1:55555<\/b> 22) It realizes that it should be sent directly to<\/p>\n<p>, since it is in the same network, therefore, it has a corresponding entry in the routing table that directs packets for all <b>192.168.B.1<\/b>. <b>192.168.B.0\/24 <\/b>directly;<\/p>\n<p>23) the router finds the MAC address for <b>192.168.B.1<\/b> and forwards this packet to it;<\/p>\n<p>24) the operating system on the computer with the address <b>192.168.B.1<\/b> receives the packet from <b>A.A.A.2:13389<\/b> for <b>192.168.B.1:55555<\/b> and initiates the next steps to establish a TCP connection.<\/p>\n<p>It should be noted that in this case, the computer with the address <b>192.168.B.1<\/b> knows nothing about the server with the address <b>192.168.A.1<\/b>, it only communicates with <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>. Similarly, the server with the address <b>192.168.A.1<\/b> knows nothing about the computer with the address <b>192.168.B.1<\/b>. It believes that it has been contacted from the address <b>B.B.B.1<\/b>, and it does not know anything else, so to speak.<\/p>\n<p>It\u2019s also worth noting that if this computer accesses <b>A.A.A.2:1540<\/b>, the connection will not be established because port 1540 is not configured for connection forwarding on the virtual router, even if there are any servers in the virtual network <b>192.168.A.0\/24<\/b> (for example, on the server with the address <b>192.168.A.1<\/b>) and there are services waiting for connections on that port. If the user of the computer with the address <b>192.168.B.1<\/b> urgently needs to establish a connection with this service, they must use VPN, that is, connect directly to <b>192.168.A.1:1540<\/b>.<\/p>\n<p>It should be emphasized that any attempts to establish a connection with <b>A.A.A.1<\/b> (except for IPSec connections from <b>B.B.B.1<\/b> ) will not be successful. Any attempts to establish connections with <b>, it goes not through the VPN, but directly. This means that if a user from address<\/b>, except for connections to port 13389, will also not be successful. <br \/>\nIt should also be noted that in the event that someone else (for example, C.C.C.C) accesses<b> , it goes not through the VPN, but directly. This means that if a user from address <\/b>, everything mentioned in points 10-20 will apply to them as well. What happens before and after depends on what exactly is behind this C.C.C.C. We do not have such information, therefore we recommend consulting the administrators of the node with the address C.C.C.C.<\/p>\n<h3>Third position<\/h3>\n<p>\nAnd conversely, if from<b> 192.168.A.1 <\/b>anything is sent to any port that is configured for forwarding inside to B.B.B.1 (for example, 11111), it also does not go into the VPN but simply goes through <b>A.A.A.1<\/b> and arrives at <b>B.B.B.1<\/b>, and that one forwards it somewhere to, say, <b>192.168.B.2:3389<\/b>. That one sees this packet not from <b>192.168.A.1<\/b>, but from <b>A.A.A.1<\/b>. And, when <b>192.168.B.2<\/b> responds, the packet goes from <b>B.B.B.1<\/b> to <b>A.A.A.1,<\/b> and later reaches the connection initiator \u2014 <b>192.168.A.1<\/b>.<\/p>\n<p>A specific example:<\/p>\n<p>1) <b>192.168.A.1<\/b> calls <b>B.B.B.1<\/b>, wants to establish a TCP connection with <b>B.B.B.1:11111<\/b>;<\/p>\n<p>2) <b>192.168.A.1<\/b> sends a request to establish a connection from <b>192.168.A.1:55555<\/b> , it does not exist, which means it forwards the packet via the default route (0.0.0.0\/0); <b>B.B.B.1:11111<\/b>;<\/p>\n<p>3) the operating system that runs on the server with the address <b>192.168.A.1<\/b>, decides to send this packet to the gateway address of the router (<b>192.168.A.254<\/b> in our case), because it does not have other, more specific routes for <b>B.B.B.1<\/b>, so it sends the packet via the default route (0.0.0.0\/0);<\/p>\n<p>4) for this, as we mentioned in previous examples, it tries to find the MAC address for the IP address <b>192.168.A.254<\/b> in the ARP protocol cache table. If not found, it sends from the address <b>192.168.A.1<\/b> a broadcast who-has request to the network <b>192.168.A.0\/24<\/b>When <b>192.168.A.254<\/b> in response, it sends its MAC address to it, the system sends an Ethernet packet for it, and records this information in its cache table;<\/p>\n<p>5) The virtual router receives this packet and determines where to send it: it has a policy that requires it to NAT (modifying the source address) all packets from <b>192.168.A.0\/24<\/b> to other nodes of the Internet;<\/p>\n<p>6) since this policy requires the source address to match the lowest address on the interface through which this packet will be sent, the virtual router first decides to whom exactly to send this packet, and, as in the previous example, it must send it to <b>A.A.A.254<\/b> (the internet service provider's gateway, which, in this case, is also us), because there are no more specific routes to <b>B.B.B.1<\/b>, than 0.0.0.0\/0;<\/p>\n<p>7) thus, the virtual router replaces the source address of the packet, from now on it is a packet from <b>A.A.A.1:44444<\/b> (the port number, of course, can be different) to <b>B.B.B.1:11111<\/b>;<\/p>\n<p>8) The virtual router remembers what it did, thus, when from <b>B.B.B.1:11111<\/b> for <b>A.A.A.1:44444<\/b> comes in, it will know that it should change the address and port of the recipient to <b>192.168.A.1:55555<\/b>.<\/p>\n<p>9) now the virtual router must send it to the ISP's network through <b>A.A.A.254<\/b>, therefore, just as we mentioned before, it finds the MAC address for <b>A.A.A.254 <\/b>and sends the packet to the ISP gateway;<\/p>\n<p>10) Internet service providers transmit the packet through their networks from <b>A.A.A.1 on B.B.B.1<\/b>;<\/p>\n<p>11) The router at <b>B.B.B.1<\/b> receives this packet on port 11111;<\/p>\n<p>12) on the virtual router, there exists a rule that states that packets received from any sender on this port should be forwarded to <b>192.168.B.2:3389<\/b>;<\/p>\n<p>13) The router finds in the routing table the network <b>192.168.B.0\/24<\/b> and sends it directly to <b>192.168.B.2<\/b>, since it has an interface <b>192.168.B.254\/24<\/b>;<\/p>\n<p>14) For this, the virtual router finds the MAC address for <b>192.168.B.2<\/b> and sends this packet to it over a virtual Ethernet network;<\/p>\n<p>15) <b>192.168.B.2<\/b> receives this packet on port 3389, agrees to establish a connection and forms a response packet from <b>192.168.B.2:3389<\/b> to <b>A.A.A.1:44444<\/b>;<\/p>\n<p>16) its system forwards this packet to the gateway address of the router (<b>192.168.B.254<\/b> in our case), because it does not have other, more specific routes for <b>A.A.A.1<\/b>, it does not have, so it must send the packet via the default route (0.0.0.0\/0);<\/p>\n<p>17) just as in previous cases, the system operating on the computer with the address <b>192.168.B.2<\/b>, finds the MAC address <b>192.168.B.254<\/b>, since it is in the same network as its interface <b>192.168.B.2\/24<\/b>;<\/p>\n<p>18) The router receives this packet. It is worth noting that it remembers what it received at <b>B.B.B.1:11111<\/b> and changed its address and recipient port to <b>A.A.A.1 <\/b>, therefore, for the packet from <b>192.168.B.2:3389<\/b>it changes the sender's address to <b>192.168.B.2:3389<\/b> for <b>A.A.A.1:44444<\/b> 19) The virtual router decides to whom to send this packet, it sends it to <b>B.B.B.1:11111<\/b>;<\/p>\n<p>19) The router determines to whom to forward this packet. It sends it to, let\u2019s say,<b> B.B.B.254 <\/b>(the gateway of the Internet provider, the exact address of which we do not know), because there are no more specific routes to <b>A.A.A.1<\/b>, than 0.0.0.0\/0;<\/p>\n<p>21) The router at <b>B.B.B.1<\/b> to <b>A.A.A.1<\/b>;<\/p>\n<p>21) the virtual router at<b> A.A.A.1 <\/b>, it changed its sender address and port to <b>192.168.A.1:55555<\/b> for <b>B.B.B.1:11111<\/b>, so this is a response that needs to be sent to <b>A.A.A.1:44444<\/b>. Thus, this is the response that needs to be forwarded to <b>192.168.A.1:55555<\/b> (in fact, as we mentioned in the previous example, there are also several checks there, but this time we will not delve into them);<\/p>\n<p>22) it understands that it should send it directly to <b>192.168.A.1<\/b>, since it is on the same network, therefore, it has a corresponding entry in the routing table that causes it to send packets for all <b>192.168.A.0\/24<\/b> directly;<\/p>\n<p>23) the router finds the MAC address for <b>192.168.A.1<\/b> and forwards this packet to it;<\/p>\n<p>24) the operating system on the server with the address <b>192.168.A.1<\/b> receives the packet from <b>B.B.B.1:1111<\/b>1 for <b>192.168.A.1:55555 <\/b>and initiates the next steps to establish a TCP connection.<\/p>\n<p>Just as in the previous case, in this case the server with the address <b>192.168.A.1<\/b> knows nothing about the computer with the address <b>192.168.B.1<\/b>, it only communicates with <b>B.B.B.1<\/b>. The computer with the address <b>192.168.B.1<\/b> also knows nothing about the server with the address <b>192.168.A.1<\/b>. It believes that it has been contacted from the address <b>A.A.A.1<\/b>, and the rest is hidden from it.<\/p>\n<h3>Output<\/h3>\n<p>\nThis is how everything occurs during connections inside the VPN tunnel between the client's office and the cloud environment, as well as during connections outside the VPN tunnel. If you have any questions or need our help with cloud solutions, <noindex><a rel=\"nofollow\" href=\"https:\/\/tucha.ua\/ru\/contacts\">feel free to contact us 24\/7.<\/a><\/noindex><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/477854\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418\u0437 \u043f\u0438\u0441\u0435\u043c \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Tucha \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0430\u043a, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043a \u043d\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 VPN-\u0442\u0443\u043d\u043d\u0435\u043b\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u0444\u0438\u0441\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0441\u0440\u0435\u0434\u043e\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0435 VPN-\u0442\u0443\u043d\u043d\u0435\u043b\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435, \u2014 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":53573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-53572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418\u0437 \u043f\u0438\u0441\u0435\u043c \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Tucha \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438 \u0432\u043d\u0435 VPN-\u0442\u0443\u043d\u043d\u0435\u043b\u044f | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418\u0437 \u043f\u0438\u0441\u0435\u043c \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Tucha \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-12-04T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:01:29+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47What happens during connections inside and outside the VPN tunnel | ProHoster","description":"Real articles are born from emails sent to Tucha's support service.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438 \u0432\u043d\u0435 VPN-\u0442\u0443\u043d\u043d\u0435\u043b\u044f | ProHoster","og:description":"\u0418\u0437 \u043f\u0438\u0441\u0435\u043c \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Tucha \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/chto-proishodit-pri-soedineniyah-vnutri-i-vne-vpn-tunnelya","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-12-04T21:00:00+00:00","article:modified_time":"2020-02-18T11:01:29+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"53572","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-02-04 15:17:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 20:22:50","updated":"2026-02-04 15:17:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=53572"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53572\/revisions"}],"predecessor-version":[{"id":156714,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53572\/revisions\/156714"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/53573"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=53572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=53572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=53572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}