Answer the question
In order to leave comments, you need to log in
Why is GIT port forwarding not working?
[Solved]
Hello!
Can you please tell me what I didn't take into account (or what I'm doing wrong)?
We want to ask the port to the locally installed git with repositories through an intermediate host (proxy) - such an architecture.
Incoming port 443 is open on the proxy, port 2222 is open on GIT (on which git is running)
The connection string to git works from the local network: ssh://[email protected][local_ip]:2222/[gitcatalogPath ] I
planned to achieve forwarding using port forwarding from the Internet of such a connection (directly to git is impossible).
After applying the rules described below, access from outside does not pass.
If you specify ssh, then:
ssh://[email protected][public_ip]:443/[gitcatalogPath]
Could not read from remote repository.
https://[email protected][public_ip]:443/[gitcatalogPath]
unable to access 'https://[public_ip]:443/[gitcatalogPath]': Failed to connect to public_ip port 443: Timed out
sudo firewall-cmd --zone=public --add-masquerade
sudo firewall-cmd --permanent --zone=external --add-forward-port=port=443:proto=tcp:toport=2222:toaddr=[local_ip]
firewall-cmd --permanent --list-all --zone=public
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: cockpit dhcpv6-client http https ssh
ports:
protocols:
masquerade: no
forward-ports:
port=443:proto=tcp:toport=2222:toaddr=[local_ip]
source-ports:
icmp-blocks:
rich rules:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question