{"id":256208,"date":"2024-04-24T12:22:59","date_gmt":"2024-04-24T04:22:59","guid":{"rendered":"https:\/\/blog.zhenglei.net\/?p=256208"},"modified":"2024-04-24T12:28:40","modified_gmt":"2024-04-24T04:28:40","slug":"tailscale-vpn-bypass-firewall","status":"publish","type":"post","link":"https:\/\/blog.zhenglei.net\/?p=256208","title":{"rendered":"Tailscale vpn bypass firewall"},"content":{"rendered":"\n<p>Sometime, we need to bypass the firewall.<\/p>\n\n\n\n<p>Suppose there are two linux box,  a local box and a remote box,  the local box unable to access some URL, due to the firewall limitation, while the remote box have no limitation.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>We setup one tailscale vpn between these two nodes,  as describe in <a href=\"https:\/\/tailscale.com\/kb\/1017\/install\">https:\/\/tailscale.com\/kb\/1017\/install<\/a><\/p>\n\n\n\n<p>Now we config a exit node, to bypass the firewall of the local linux box.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Remore linux<\/strong>:  Enable IP forward  &amp;  Add exit-node:<\/p>\n\n\n\n<p>sudo sed -i &#8220;s\/#net.ipv4.ip_forward=1\/net.ipv4.ip_forward=1\/&#8221;     \/etc\/sysctl.conf<\/p>\n\n\n\n<p>sudo sed -i &#8220;s\/#net.ipv6.conf.all.forwarding=1\/net.ipv6.conf.all.forwarding=1\/&#8221; \/etc\/sysctl.conf <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -p \/etc\/sysctl.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tailscale up --advertise-exit-node<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Tailscale admin webpage<\/strong>:     Approve the exit node<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Local linux:<\/strong>  Use exit-node:\n\nsudo sed -i \"s\/#net.ipv4.conf.all.rp_filter=1\/net.ipv4.conf.all.rp_filter=2\/\"  \/etc\/sysctl.conf\n\n\nsudo sysctl -p \/etc\/sysctl.conf\n\nsudo tailscale up --accept-routes --exit-node-allow-lan-access --exit-node=RemoteIP<\/code><\/pre>\n\n\n\n<p> Where RemoteIP is the vpn ip of remote node,  say 100.113.189.45<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometime, we need to bypass the firewall &hellip; <a href=\"https:\/\/blog.zhenglei.net\/?p=256208\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,9],"tags":[411,73,410,50],"class_list":["post-256208","post","type-post","status-publish","format-standard","hentry","category-software-download","category-vps","tag-firewall","tag-linux-2","tag-tailscale","tag-vpn"],"_links":{"self":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256208"}],"version-history":[{"count":2,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256208\/revisions"}],"predecessor-version":[{"id":256211,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256208\/revisions\/256211"}],"wp:attachment":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}