vpn_site2site_usando_zerotier_con_bridge_en_lxc
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| vpn_site2site_usando_zerotier_con_bridge_en_lxc [2024/10/28 17:26] – [Troubleshooting Guide: Enabling Forwarding Between LXC and ZeroTier Networks] 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: Log All Forwarded Packets === | ||
| - | |||
| - | Yes, you can enable logging in '' | ||
| - | |||
| - | Here’s a basic process to enable logging and capture relevant details: | ||
| - | |||
| - | == Step 1: Add a Logging Rule in '' | ||
| - | |||
| - | You can add a logging rule before the DROP rule on the '' | ||
| - | |||
| - | < | ||
| - | # Log all forwarded packets | ||
| - | sudo iptables -I FORWARD 1 -j LOG --log-prefix " | ||
| - | </ | ||
| - | |||
| - | This command inserts a logging rule at the top of the '' | ||
| - | - '' | ||
| - | - '' | ||
| - | |||
| - | == Step 2: Check the Logs == | ||
| - | |||
| - | After adding the logging rule, you can view logged packets in the system log files, typically in ''/ | ||
| - | |||
| - | Use this command to see recent logs: | ||
| - | |||
| - | < | ||
| - | |||
| - | This will show only the logs with the prefix `FORWARD DROP:`, making it easier to analyze just the forwarded traffic. | ||
| - | |||
| - | == Step 3: Analyze the Log Output == | ||
| - | |||
| - | In the log, you should see details like the source and destination IP addresses, ports, and interfaces involved. If the packets are getting dropped, `iptables` might be blocking them for one of the following reasons: | ||
| - | * A DROP rule after your LOG rule. | ||
| - | * Missing MASQUERADE/ | ||
| - | * Routing issues on the router or VPN settings. | ||
| - | |||
| - | == Step 4: Remove Logging Rule After Debugging == | ||
| - | |||
| - | Once you've found the issue, remember to remove the logging rule to avoid excessive log entries: | ||
| - | |||
| - | < | ||
| - | |||
| - | |||
| - | If you’re still having issues, it might help to check if the NAT configuration is correct for forwarding traffic from your router to ZeroTier. | ||
| - | |||
| - | === Step 2: Allow Forwarding from lxcbr0 to ZeroTier Interface === | ||
| - | |||
| - | Allow traffic from '' | ||
| - | < | ||
| - | |||
| - | === Step 3: Allow Reverse Path for Response Traffic === | ||
| - | |||
| - | Add a reverse rule to allow return traffic from ZeroTier to the LXC bridge: | ||
| - | < | ||
| - | |||
| - | === Step 4: Enable NAT (If Required) === | ||
| - | |||
| - | Enable NAT to allow traffic between ZeroTier and '' | ||
| - | < | ||
| - | |||
| - | === Step 5: Verify IP Forwarding is Enabled === | ||
| - | |||
| - | Check and enable IP forwarding if not already active: | ||
| - | < | ||
| - | |||
| - | To persist this change, add '' | ||
| - | |||
| - | === Step 6: Test and Monitor === | ||
| - | |||
| - | After applying these configurations, | ||
vpn_site2site_usando_zerotier_con_bridge_en_lxc.1730136394.txt.gz · Last modified: 2024/10/28 17:26 by oso
