ubuntu server fqdn refusing to connect to website only when connected to openvpn
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
Running on my Ubuntu Server I have
Openvpn Server + Pihole Dns (routing only dns)
& an iredmail server
I have a domain name which I have pointed to the server, and a fqdn is set
Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.
eg.
Connecting to openvpn server using domain in openvpn client config works âÂÂ
connecting to ssh works using domain âÂÂ
connecting to online mail inbox using domain works âÂÂ
when connected to vpn,
all work when connecting via server's public ip address âÂÂ
but refuse connection when using domain.
Im assuming its an firewall/iptables issue but im headdesking rn.
here are my iptables rules (ive combined rules of iredmail and pihole)
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# ssh
-A INPUT -p tcp --dport 27 -j ACCEPT
# http, https
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# smtp, submission
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
# pop3, pop3s
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
#-A INPUT -p tcp --dport 10110 -j ACCEPT
# imap, imaps
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
#-A INPUT -p tcp --dport 10143 -j ACCEPT
# lmtp
#-A INPUT -p tcp --dport 24 -j ACCEPT
#-A INPUT -p tcp --dport 1024 -j ACCEPT
# managesieve
#-A INPUT -p tcp --dport 4190 -j ACCEPT
#-A INPUT -p tcp --dport 10419 -j ACCEPT
# Dovecot SASL AUTH service for HAProxy
#-A INPUT -p tcp --dport 12346 -j ACCEPT
# ldap/ldaps
#-A INPUT -p tcp --dport 389 -j ACCEPT
#-A INPUT -p tcp --dport 636 -j ACCEPT
#-A INPUT -p tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp --dport 4444 -j ACCEPT
#-A INPUT -p tcp --dport 4567 -j ACCEPT
#-A INPUT -p tcp --dport 4568 -j ACCEPT
# PostgreSQL service.
#-A INPUT -p tcp --dport 5432 -j ACCEPT
# Amavisd
#-A INPUT -p tcp --dport 10024 -j ACCEPT
#-A INPUT -p tcp --dport 10025 -j ACCEPT
#-A INPUT -p tcp --dport 10026 -j ACCEPT
#-A INPUT -p tcp --dport 9998 -j ACCEPT
# iRedAPD
#-A INPUT -p tcp --dport 7777 -j ACCEPT
# ftp.
#-A INPUT -p tcp --dport 20 -j ACCEPT
#-A INPUT -p tcp --dport 21 -j ACCEPT
# ejabberd
#-A INPUT -p tcp --dport 5222 -j ACCEPT
#-A INPUT -p tcp --dport 5223 -j ACCEPT
#-A INPUT -p tcp --dport 5280 -j ACCEPT
-I INPUT -i tun0 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT
-A INPUT -p tcp --destination-port 27 -j ACCEPT
-A INPUT -p tcp --destination-port 1194 -j ACCEPT
-A INPUT -p udp --destination-port 1194 -j ACCEPT
-I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-I INPUT -i lo -j ACCEPT
#-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
#-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
#-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
COMMIT
and the result of ip routes
default via 192.168.1.1 dev enp2s1 proto static
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200
networking dns iptables firewall openvpn
add a comment |Â
up vote
0
down vote
favorite
Running on my Ubuntu Server I have
Openvpn Server + Pihole Dns (routing only dns)
& an iredmail server
I have a domain name which I have pointed to the server, and a fqdn is set
Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.
eg.
Connecting to openvpn server using domain in openvpn client config works âÂÂ
connecting to ssh works using domain âÂÂ
connecting to online mail inbox using domain works âÂÂ
when connected to vpn,
all work when connecting via server's public ip address âÂÂ
but refuse connection when using domain.
Im assuming its an firewall/iptables issue but im headdesking rn.
here are my iptables rules (ive combined rules of iredmail and pihole)
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# ssh
-A INPUT -p tcp --dport 27 -j ACCEPT
# http, https
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# smtp, submission
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
# pop3, pop3s
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
#-A INPUT -p tcp --dport 10110 -j ACCEPT
# imap, imaps
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
#-A INPUT -p tcp --dport 10143 -j ACCEPT
# lmtp
#-A INPUT -p tcp --dport 24 -j ACCEPT
#-A INPUT -p tcp --dport 1024 -j ACCEPT
# managesieve
#-A INPUT -p tcp --dport 4190 -j ACCEPT
#-A INPUT -p tcp --dport 10419 -j ACCEPT
# Dovecot SASL AUTH service for HAProxy
#-A INPUT -p tcp --dport 12346 -j ACCEPT
# ldap/ldaps
#-A INPUT -p tcp --dport 389 -j ACCEPT
#-A INPUT -p tcp --dport 636 -j ACCEPT
#-A INPUT -p tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp --dport 4444 -j ACCEPT
#-A INPUT -p tcp --dport 4567 -j ACCEPT
#-A INPUT -p tcp --dport 4568 -j ACCEPT
# PostgreSQL service.
#-A INPUT -p tcp --dport 5432 -j ACCEPT
# Amavisd
#-A INPUT -p tcp --dport 10024 -j ACCEPT
#-A INPUT -p tcp --dport 10025 -j ACCEPT
#-A INPUT -p tcp --dport 10026 -j ACCEPT
#-A INPUT -p tcp --dport 9998 -j ACCEPT
# iRedAPD
#-A INPUT -p tcp --dport 7777 -j ACCEPT
# ftp.
#-A INPUT -p tcp --dport 20 -j ACCEPT
#-A INPUT -p tcp --dport 21 -j ACCEPT
# ejabberd
#-A INPUT -p tcp --dport 5222 -j ACCEPT
#-A INPUT -p tcp --dport 5223 -j ACCEPT
#-A INPUT -p tcp --dport 5280 -j ACCEPT
-I INPUT -i tun0 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT
-A INPUT -p tcp --destination-port 27 -j ACCEPT
-A INPUT -p tcp --destination-port 1194 -j ACCEPT
-A INPUT -p udp --destination-port 1194 -j ACCEPT
-I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-I INPUT -i lo -j ACCEPT
#-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
#-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
#-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
COMMIT
and the result of ip routes
default via 192.168.1.1 dev enp2s1 proto static
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200
networking dns iptables firewall openvpn
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Running on my Ubuntu Server I have
Openvpn Server + Pihole Dns (routing only dns)
& an iredmail server
I have a domain name which I have pointed to the server, and a fqdn is set
Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.
eg.
Connecting to openvpn server using domain in openvpn client config works âÂÂ
connecting to ssh works using domain âÂÂ
connecting to online mail inbox using domain works âÂÂ
when connected to vpn,
all work when connecting via server's public ip address âÂÂ
but refuse connection when using domain.
Im assuming its an firewall/iptables issue but im headdesking rn.
here are my iptables rules (ive combined rules of iredmail and pihole)
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# ssh
-A INPUT -p tcp --dport 27 -j ACCEPT
# http, https
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# smtp, submission
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
# pop3, pop3s
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
#-A INPUT -p tcp --dport 10110 -j ACCEPT
# imap, imaps
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
#-A INPUT -p tcp --dport 10143 -j ACCEPT
# lmtp
#-A INPUT -p tcp --dport 24 -j ACCEPT
#-A INPUT -p tcp --dport 1024 -j ACCEPT
# managesieve
#-A INPUT -p tcp --dport 4190 -j ACCEPT
#-A INPUT -p tcp --dport 10419 -j ACCEPT
# Dovecot SASL AUTH service for HAProxy
#-A INPUT -p tcp --dport 12346 -j ACCEPT
# ldap/ldaps
#-A INPUT -p tcp --dport 389 -j ACCEPT
#-A INPUT -p tcp --dport 636 -j ACCEPT
#-A INPUT -p tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp --dport 4444 -j ACCEPT
#-A INPUT -p tcp --dport 4567 -j ACCEPT
#-A INPUT -p tcp --dport 4568 -j ACCEPT
# PostgreSQL service.
#-A INPUT -p tcp --dport 5432 -j ACCEPT
# Amavisd
#-A INPUT -p tcp --dport 10024 -j ACCEPT
#-A INPUT -p tcp --dport 10025 -j ACCEPT
#-A INPUT -p tcp --dport 10026 -j ACCEPT
#-A INPUT -p tcp --dport 9998 -j ACCEPT
# iRedAPD
#-A INPUT -p tcp --dport 7777 -j ACCEPT
# ftp.
#-A INPUT -p tcp --dport 20 -j ACCEPT
#-A INPUT -p tcp --dport 21 -j ACCEPT
# ejabberd
#-A INPUT -p tcp --dport 5222 -j ACCEPT
#-A INPUT -p tcp --dport 5223 -j ACCEPT
#-A INPUT -p tcp --dport 5280 -j ACCEPT
-I INPUT -i tun0 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT
-A INPUT -p tcp --destination-port 27 -j ACCEPT
-A INPUT -p tcp --destination-port 1194 -j ACCEPT
-A INPUT -p udp --destination-port 1194 -j ACCEPT
-I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-I INPUT -i lo -j ACCEPT
#-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
#-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
#-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
COMMIT
and the result of ip routes
default via 192.168.1.1 dev enp2s1 proto static
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200
networking dns iptables firewall openvpn
Running on my Ubuntu Server I have
Openvpn Server + Pihole Dns (routing only dns)
& an iredmail server
I have a domain name which I have pointed to the server, and a fqdn is set
Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.
eg.
Connecting to openvpn server using domain in openvpn client config works âÂÂ
connecting to ssh works using domain âÂÂ
connecting to online mail inbox using domain works âÂÂ
when connected to vpn,
all work when connecting via server's public ip address âÂÂ
but refuse connection when using domain.
Im assuming its an firewall/iptables issue but im headdesking rn.
here are my iptables rules (ive combined rules of iredmail and pihole)
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# ssh
-A INPUT -p tcp --dport 27 -j ACCEPT
# http, https
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# smtp, submission
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
# pop3, pop3s
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
#-A INPUT -p tcp --dport 10110 -j ACCEPT
# imap, imaps
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
#-A INPUT -p tcp --dport 10143 -j ACCEPT
# lmtp
#-A INPUT -p tcp --dport 24 -j ACCEPT
#-A INPUT -p tcp --dport 1024 -j ACCEPT
# managesieve
#-A INPUT -p tcp --dport 4190 -j ACCEPT
#-A INPUT -p tcp --dport 10419 -j ACCEPT
# Dovecot SASL AUTH service for HAProxy
#-A INPUT -p tcp --dport 12346 -j ACCEPT
# ldap/ldaps
#-A INPUT -p tcp --dport 389 -j ACCEPT
#-A INPUT -p tcp --dport 636 -j ACCEPT
#-A INPUT -p tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp --dport 4444 -j ACCEPT
#-A INPUT -p tcp --dport 4567 -j ACCEPT
#-A INPUT -p tcp --dport 4568 -j ACCEPT
# PostgreSQL service.
#-A INPUT -p tcp --dport 5432 -j ACCEPT
# Amavisd
#-A INPUT -p tcp --dport 10024 -j ACCEPT
#-A INPUT -p tcp --dport 10025 -j ACCEPT
#-A INPUT -p tcp --dport 10026 -j ACCEPT
#-A INPUT -p tcp --dport 9998 -j ACCEPT
# iRedAPD
#-A INPUT -p tcp --dport 7777 -j ACCEPT
# ftp.
#-A INPUT -p tcp --dport 20 -j ACCEPT
#-A INPUT -p tcp --dport 21 -j ACCEPT
# ejabberd
#-A INPUT -p tcp --dport 5222 -j ACCEPT
#-A INPUT -p tcp --dport 5223 -j ACCEPT
#-A INPUT -p tcp --dport 5280 -j ACCEPT
-I INPUT -i tun0 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT
-A INPUT -p tcp --destination-port 27 -j ACCEPT
-A INPUT -p tcp --destination-port 1194 -j ACCEPT
-A INPUT -p udp --destination-port 1194 -j ACCEPT
-I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-I INPUT -i lo -j ACCEPT
#-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
#-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
#-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
COMMIT
and the result of ip routes
default via 192.168.1.1 dev enp2s1 proto static
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200
networking dns iptables firewall openvpn
asked May 13 at 13:18
![](https://lh3.googleusercontent.com/-njloe1IqhpA/AAAAAAAAAAI/AAAAAAAAIOI/h265QKsmejI/photo.jpg?sz=32)
![](https://lh3.googleusercontent.com/-njloe1IqhpA/AAAAAAAAAAI/AAAAAAAAIOI/h265QKsmejI/photo.jpg?sz=32)
wlvar
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1035700%2fubuntu-server-fqdn-refusing-to-connect-to-website-only-when-connected-to-openvpn%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password