vpn_site2site_usando_zerotier_con_bridge_en_lxc
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| vpn_site2site_usando_zerotier_con_bridge_en_lxc [2024/10/28 16:57] – [Notes] oso | vpn_site2site_usando_zerotier_con_bridge_en_lxc [2025/07/10 15:41] (current) – oso | ||
|---|---|---|---|
| Line 107: | Line 107: | ||
| ---- | ---- | ||
| - | |||
| - | |||
| - | ===== About the IPTables Setup ===== | ||
| - | |||
| - | |||
| - | **Summary of IPTables Configuration for Gateway Setup** | ||
| - | |||
| - | We configured IPTables to allow `srv05` to act as a gateway between the `10.241.0.0/ | ||
| - | |||
| - | ### IPTables Rules Configuration | ||
| - | |||
| - | The configuration is as follows: | ||
| - | |||
| - | < | ||
| - | # Generated by iptables-save v1.8.10 (nf_tables) on Sun Oct 27 21:46:33 2024 | ||
| - | *filter | ||
| - | :INPUT ACCEPT [27860: | ||
| - | :FORWARD ACCEPT [0:0] | ||
| - | :OUTPUT ACCEPT [0:0] | ||
| - | -A INPUT -p tcp -m tcp --dport 6162 -m comment --comment "Veeam transport rule" -j ACCEPT | ||
| - | -A INPUT -p tcp -m tcp --dport 6160 -m comment --comment "Veeam deployment rule" -j ACCEPT | ||
| - | COMMIT | ||
| - | |||
| - | *nat | ||
| - | :PREROUTING ACCEPT [0:0] | ||
| - | :INPUT ACCEPT [0:0] | ||
| - | :OUTPUT ACCEPT [0:0] | ||
| - | : | ||
| - | -A POSTROUTING -o lxcbr0 -s 10.241.0.0/ | ||
| - | COMMIT | ||
| - | |||
| - | *filter | ||
| - | :INPUT ACCEPT [0:0] | ||
| - | :FORWARD DROP [0:0] | ||
| - | -A FORWARD -s 10.241.0.0/ | ||
| - | -A FORWARD -s 192.168.88.0/ | ||
| - | :OUTPUT ACCEPT [0:0] | ||
| - | COMMIT | ||
| - | </ | ||
| - | |||
| - | ==== Notes ==== | ||
| - | |||
| - | * **Routing**: | ||
| - | * **SNAT Rule**: The '' | ||
| - | * **Unprivileged LXC Consideration**: | ||
| - | |||
| - | |||
| - | ---- | ||
| - | |||
| - | |||
| - | ==== Troubleshooting Guide: Enabling Forwarding Between LXC and ZeroTier Networks ==== | ||
| - | |||
| - | When troubleshooting connectivity between an LXC bridge ('' | ||
| - | |||
| - | === Step 1: Allow Forwarding from lxcbr0 to ZeroTier Interface === | ||
| - | |||
| - | To allow traffic from '' | ||
| - | |||
| - | < | ||
| - | sudo iptables -I FORWARD 1 -i lxcbr0 -o ztkse3ixxp -j ACCEPT | ||
| - | </ | ||
| - | |||
| - | This command permits traffic from '' | ||
| - | |||
| - | === Step 2: Allow Reverse Path for Response Traffic === | ||
| - | |||
| - | To allow return traffic from ZeroTier to the LXC bridge, add a reverse rule: | ||
| - | |||
| - | < | ||
| - | sudo iptables -I FORWARD 1 -i ztkse3ixxp -o lxcbr0 -j ACCEPT | ||
| - | </ | ||
| - | |||
| - | This allows responses from ZeroTier-connected devices to reach devices on the '' | ||
| - | |||
| - | === Step 3: Enable NAT (If Required) === | ||
| - | |||
| - | If the ZeroTier network doesn’t natively recognize the '' | ||
| - | |||
| - | < | ||
| - | sudo iptables -t nat -A POSTROUTING -o ztkse3ixxp -s 192.168.88.0/ | ||
| - | </ | ||
| - | |||
| - | This step is essential if routing between networks is not configured. | ||
| - | |||
| - | === Step 4: Verify IP Forwarding is Enabled === | ||
| - | |||
| - | Check if IP forwarding is active: | ||
| - | |||
| - | < | ||
| - | sysctl net.ipv4.ip_forward | ||
| - | </ | ||
| - | |||
| - | If the output is '' | ||
| - | |||
| - | < | ||
| - | sudo sysctl -w net.ipv4.ip_forward=1 | ||
| - | </ | ||
| - | |||
| - | To make this change persistent across reboots, add the following line to ''/ | ||
| - | |||
| - | < | ||
| - | net.ipv4.ip_forward=1 | ||
| - | </ | ||
| - | |||
| - | === Step 5: Test and Monitor === | ||
| - | |||
| - | After applying these configurations, | ||
| - | |||
vpn_site2site_usando_zerotier_con_bridge_en_lxc.1730134648.txt.gz · Last modified: 2024/10/28 16:57 by oso
