Using WireGuard for Site-to-Site VPN

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 60

  • @pythonBlender7
    @pythonBlender7 7 месяцев назад +3

    This is pure gold I can't believe this is free :D

  • @garretts9529
    @garretts9529 Год назад +7

    This video is phenomenal and exactly what I was looking for. Thank you for putting so much work into it

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад

      Glad you liked it! I'm also planning to do some more advanced Wireguard video with BGP (Bird2).

  • @gregorgodler9037
    @gregorgodler9037 10 месяцев назад

    Following your instructions I finally managed to set VPN connection between two linux servers. Keep up the good work!

    • @LinuxCloudHacks
      @LinuxCloudHacks  10 месяцев назад

      Great to hear! If you have any questions or ideas feel free to reach out!

  • @henrik2117
    @henrik2117 Год назад +1

    Wow! Just what I was looking for!
    I really like the way you explain all the steps.
    You make it so much simpler and easier to understand than all the Web pages and guides I've found online.
    Thank you!

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад +1

      Thanks! Glad you liked it. Let me know if you have any questions or if you'd like to me cover any VPN topic.

  • @rustyabdou7860
    @rustyabdou7860 Год назад +1

    Just discovered ur channel and already watched half of ur videos !! Keep it coming dude

  • @Jeamfry
    @Jeamfry 4 месяца назад

    Really well explained, with clear examples and a lot of thought behind it! This video was really awesome. Hoping a comment helps spread the love :)

    • @LinuxCloudHacks
      @LinuxCloudHacks  4 месяца назад

      Thanks! Glad you like it. Stay tuned for more interesting content!

  • @mohamedatef8424
    @mohamedatef8424 9 месяцев назад

    Great video and explain, subscribed 🤝

  • @karthikinala24
    @karthikinala24 4 месяца назад

    Thank you so much for the video, It helped to solve my wireguard VPN problem.

  • @giannicarafone2677
    @giannicarafone2677 9 месяцев назад

    The best explanation ever!

  • @kidspro_pl
    @kidspro_pl Год назад +1

    Awesome!:) Thank you. I will try too do the same but with docker:)

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад

      Have fun! If any issues please let me know.

    • @kidspro_pl
      @kidspro_pl Год назад

      @@LinuxCloudHacks :) Thank you. Everything works as expected even "bugs" (ping not responding) :)

  • @EmperorTerran
    @EmperorTerran 6 месяцев назад

    So well done!

  • @rezamira3192
    @rezamira3192 2 месяца назад

    thanks a lot for great video, was very helpful
    this scenario can work for point to multipoint vpn instead of site-to-site
    I mean hub-and-spoke scenario instead of full mesh

    • @LinuxCloudHacks
      @LinuxCloudHacks  2 месяца назад

      Glad it helped!

    • @rezamira3192
      @rezamira3192 2 месяца назад

      @@LinuxCloudHacks yes, was very very helpful,
      would you please tell me this scenario works as a hub-and-spoke topology?

    • @LinuxCloudHacks
      @LinuxCloudHacks  2 месяца назад +1

      Hi. Please check my video on hub and spoke ruclips.net/video/_CbFG_4BInk/видео.htmlsi=U550GwDCt8zSfMZ9
      If you want to interconnect two or more sites in a hub and spoke it's better to have separate WG tunnels (as it's much easier to route the traffic).

    • @rezamira3192
      @rezamira3192 2 месяца назад

      @@LinuxCloudHacks thanks a lot, let me check your video firstly and back to u

    • @rezamira3192
      @rezamira3192 2 месяца назад

      @@LinuxCloudHacks separate WG tunnel means the current video?

  • @eric-seastrand
    @eric-seastrand Год назад

    Great video! Subscribed

  • @allandresner
    @allandresner 11 месяцев назад

    Thank you very much

    • @LinuxCloudHacks
      @LinuxCloudHacks  11 месяцев назад +1

      You are welcome! I'm preparing a Wireguard tutorial for Hub and Spoke topology with dynamic routing via OSPF. It will be released soon. Stay tuned!

  • @user-tk7sc4gz2v
    @user-tk7sc4gz2v Месяц назад

    great video!! one question, why interface address is 172.16.1.x/24 while to allow this interface we use 172.16.1.x/32 in allowed ips? can't we use /32 for interface address

    • @LinuxCloudHacks
      @LinuxCloudHacks  Месяц назад +1

      Thanks! To your question - you still need an entry in the routing table that will send traffic via WG0 interface. In other words standard routing rules apply. If you look at the routing table you have an entry:
      172.16.0.0/24 dev wg0 scope link
      Basically it tells that 172.16.0.0/24 network is reachable via wg0 (wireguard interface).
      So when you send traffic, first it will lookup the kernel routing table, then
      "enter" WG interface and then Wireguard Cryptokey Routing Table is used to figure out which encryption key to use and which peer to send the traffic etc.
      BTW as far as /32 on the main interface. The most common way to setup wireguard is to use PTP links. That is:
      # tunnel.conf
      [Interface]
      PrivateKey =
      ListenPort =
      [Peer]
      PublicKey =
      PresharedKey =
      Endpoint =
      AllowedIPs = 0.0.0.0/0,::/0
      $ ip link add dev type wireguard
      $ wg setconf tunnel.conf
      $ ip addr add fe80::/64 dev
      $ ip addr add 172.xx.xx.xx/32 peer 172.xx.xx.xx/32 dev
      $ ip link set up
      $ ip link set dev mtu 1420 (or 1440)

    • @user-tk7sc4gz2v
      @user-tk7sc4gz2v Месяц назад

      @@LinuxCloudHacks thanks for explaining!!

  • @sanjalon
    @sanjalon Месяц назад

    1st, thank you for this to-the-point-entertainment-free informative video!
    In my setup, i have two remote private networks (one of them is behind a CGNAT). I followed your video and one wg node is able to ping the other wg node via the private network IP address. however I am not able to ping any other devices on the remote private network, only the wg node itself.
    I did add a routing rule on both network gateways (both Unifi USG) so as to route traffic to the remote private network through the local wg node. When I do a traceroute, i see that the first hop indeed lands on the local wg node, but appears to stop there.
    Any tips would be greatly appreciated.

    • @LinuxCloudHacks
      @LinuxCloudHacks  Месяц назад

      Hi! Are you using wg-quick script to bring up wireguard? If yes then it will automatically update your routing table (just add the private network of the remote end in the allowedIPs section). Also make sure the ip forwarding is enabled. Can you tell me if your servers on the private network have the wireguard node set as the default gateway?

    • @sanjalon
      @sanjalon Месяц назад

      @@LinuxCloudHacks i do use wg-quick to bring up wg (i see the route table updated), the private network of the remote end is already in the allowedIPs section and ip forwarding is enabled (I followed your video to the T, except for the masquerading). on the router (Unifi USG) I've set a static route so that traffic destined for the remote private network will be sent to the local wireguard node. Is this what you meant by default gateway?

    • @sanjalon
      @sanjalon Месяц назад

      @LinuxCloudHacks i'd love to hear your thoughts, thanks :)

    • @LinuxCloudHacks
      @LinuxCloudHacks  Месяц назад

      Hi,
      1) Just for a test - can you go to a LAN device and add a static route that points to the remote LAN via the WireGuard node and on the remote site also pick a LAN device and add static route that points to the other LAN via the WireGuard node? Then try ping/traceroute just between those 2 LAN devices.
      2) I assume you include whole subnet in AllowedIPs, like 192.168.10.0/24
      3) There is no firewall or nat setup on the WG nodes, correct?

  • @batmansniper
    @batmansniper Год назад

    Please make a video of HUB and SPOKE wireguard vpn with dualstack (ipv4 and ipv6). Thanks for your hard work.

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад

      Great idea for a movie. Thanks for the tip. I will definitely do it.

  • @Channel-tm8ud
    @Channel-tm8ud 4 месяца назад

    After setting this up, let's say I'm in node 1 and I want my traffic to exit from node 2. Later to exit from node 3. How to do this?

    • @LinuxCloudHacks
      @LinuxCloudHacks  3 месяца назад

      Hi! You need exit node to the Internet with load balancing across multiple exit nodes? Or you want to connect to specific network via two paths?

  • @Osa2osX
    @Osa2osX 8 месяцев назад

    Can you make a video where only 2 VPS servers running in different public IP's interconnect? Like VPS with providerX and VPS with provider Y. But I want both to be Site to Site connected and use resources from priv network 10.3.0.0./24 and 10.2.0.0./24 but there is no public IP which is the same range of IP so 2 different Static IPv4

    • @LinuxCloudHacks
      @LinuxCloudHacks  7 месяцев назад

      Hi, in the "EndPoint = xxx" you can specify any public IP:port or hostname:port. Those don't have to be in the same networking segment (as long as they have network reachability).

  • @miladmohabati
    @miladmohabati 9 месяцев назад

    hi my friend
    that was perfect
    Please explain how to create a wireguard tunnel between two servers on Docker
    thanks

  • @georgeeivaz362
    @georgeeivaz362 Год назад

    What is the name of amazing ssh editor you are using. Love the video.

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад +7

      Hi! I'm glad you liked the video. I'm using Alacritty as the terminal emulator, TMUX as the terminal multiplexer with some key re-maping, some Powerline fonts and various flavors of VIM (still haven't found the perfect one). If you are interested then I can make a video how to wire it up together and what it can do.

    • @bhdal
      @bhdal Год назад +1

      ​@@LinuxCloudHackscould you make a video on that please?

    • @LinuxCloudHacks
      @LinuxCloudHacks  Год назад

      Will do!

  • @UnderEu
    @UnderEu 4 месяца назад

    What about the current protocol?

    • @LinuxCloudHacks
      @LinuxCloudHacks  4 месяца назад

      Could you please clarify which current protocol you are referring to? Are you asking about how WireGuard compares to other protocols like OpenVPN or IPsec, or about its compatibility with existing setups?

    • @UnderEu
      @UnderEu 4 месяца назад

      @@LinuxCloudHacks IPv6

  • @nikto3348
    @nikto3348 6 месяцев назад

    Where is Kilsswitch, where is Nat Rules, where is Bypass ISP firewall rules 😂😂😊

    • @LinuxCloudHacks
      @LinuxCloudHacks  6 месяцев назад +1

      Hi Nikto :) Thanks for the comment. I'll create a video about a road-warrior setup for Windows, MacOS, etc. and may include some of this concepts. As far as NAT goes it's good if you connect to your network but for site-to-site a route only approach is cleaner. Professionals even don't use private IPs on VPNs but route only public IPs etc.