LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-21-2021, 08:00 AM   #1
anon199
LQ Newbie
 
Registered: Aug 2021
Posts: 1

Rep: Reputation: Disabled
Question Accessing containers on Home Server through VPS blocks them from WAN (iptables)


Greetings,
I'm kind of new to this thing, but I will try to describe my problem as far as I understand it.
I want to connect to the home server through a VPS. However, some docker containers require an external network connection (WAN) to function correctly.
I use wireguard to tunnel the traffic between the VPS to the home server. Also, I added the following iptables rule to the VPS to route incoming external 443 traffic to the home server so I'll be able to connect to it from anywhere:
Code:
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.0.0.2:4433
(the home server is using port 4433 instead of 443).

Now, when I want to access a container on the home server through the VPS, there's no problem, but if this container needs an external connection, it goes to the VPS, and the VPS returns 443 requests back to the home server, and the loop continues (I guess that is what's happening). The bottom line, these containers cannot access the internet.

How can I set up the iptables rules correctly, so the home server containers still have a connection to the WAN through the VPS?
Thanks for any bits of advice!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: You are here: Home / Tips / How to Run Docker Containers How to Run Docker Containers LXer Syndicated Linux News 0 01-29-2020 03:00 PM
Iterate through all blocks in an ext4 fs and zero them out LinuxMinx Linux - Kernel 2 04-05-2019 06:26 AM
Is it possible to have 2 VPS on seperate IP blocks on the same server? abefroman Linux - Server 5 08-05-2008 10:11 PM
FreeS/Wan Vs. OpenS/Wan Vs. StrongS/Wan bkankur Linux - Security 1 03-01-2005 09:27 AM
WAN : unable to ping to WAN ckl Linux - Networking 0 11-18-2004 01:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration