LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-24-2020, 09:58 AM   #1
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Rep: Reputation: Disabled
OpenVPN not able to connect to public IP interface


I have 2 sites that used to be linked via OpenVPN. For some reason it stopped working.

General setups:
Server OS: CentOS 7
OpenVPN v2.4.9
EasyRSA v.3.0.7
Edge firewall and VPN server is the same box. Using firewalld. IPTables is not running on either machine.

Firewall settings:
Quote:
public (active)
target: DROP
icmp-block-inversion: yes
interfaces: enp2s0
sources:
services: openvpn
ports:
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
While trying to connect to the public interface, client side has been getting:

Quote:
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #1 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #2 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #3 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #4 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #5 ] [ ] pid=0 DATA len=0
TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS Error: TLS handshake failed
I've done a tcpdump of my public facing interface
Quote:
tcpdump -vni enp2s0 port 1194 and udp
Nothing shows, which tells me that the packets aren't even hitting the interface.

I have also asked my ISP whether they are actively filtering OpenVPN, to which they have answered in the negative.

Any help / advice would be greatly appreciated.
 
Old 07-24-2020, 11:47 AM   #2
marliyev
Member
 
Registered: Apr 2020
Location: Jamaica
Posts: 68

Rep: Reputation: Disabled
Quote:
Originally Posted by THawk254 View Post
I have 2 sites that used to be linked via OpenVPN. For some reason it stopped working.

General setups:
Server OS: CentOS 7
OpenVPN v2.4.9
EasyRSA v.3.0.7
Edge firewall and VPN server is the same box. Using firewalld. IPTables is not running on either machine.

Firewall settings:


While trying to connect to the public interface, client side has been getting:


I've done a tcpdump of my public facing interface


Nothing shows, which tells me that the packets aren't even hitting the interface.

I have also asked my ISP whether they are actively filtering OpenVPN, to which they have answered in the negative.

Any help / advice would be greatly appreciated.



active zone is public and target shows DROP -> a source zone with the target DROP would drop all packets, even if they were whitelisted, first, change target to default.

TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS Error: TLS handshake failed -> this message means firewall blocking conn

Last edited by marliyev; 07-24-2020 at 12:12 PM.
 
Old 07-24-2020, 06:08 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,613

Rep: Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962
Quote:
Originally Posted by THawk254 View Post
I have 2 sites that used to be linked via OpenVPN. For some reason it stopped working.
General setups:
Server OS: CentOS 7
OpenVPN v2.4.9
EasyRSA v.3.0.7
Edge firewall and VPN server is the same box. Using firewalld. IPTables is not running on either machine.

Firewall settings:
Code:
public (active)
target: DROP
icmp-block-inversion: yes
interfaces: enp2s0
sources:
services: openvpn
ports:
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
While trying to connect to the public interface, client side has been getting:
Code:
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #1 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #2 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #3 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #4 ] [ ] pid=0 DATA len=0
UDP WRITE [86] to [AF_INET](public IP Address):1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 pid=[ #5 ] [ ] pid=0 DATA len=0
TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS Error: TLS handshake failed
I've done a tcpdump of my public facing interface
Code:
tcpdump -vni enp2s0 port 1194 and udp
Nothing shows, which tells me that the packets aren't even hitting the interface. I have also asked my ISP whether they are actively filtering OpenVPN, to which they have answered in the negative.
If you're *SURE* that your firewall isn't blocking VPN on UDP 1194 (which would be the first thing to check), based on the error message it looks like the traffic is either blocked or misdirected. Do you have a firewall on your client?? Those would be first things to check is firewall on both sides. Past that, check into the "local" directive for your openVPN server config:
Code:
--local host
Local host name or IP address. If specified, OpenVPN will bind to this address only. If unspecified, OpenVPN will bind to all interfaces.
Sometimes specifying that will get things going out the right interface. Post your openvpn.conf file (sanitized of identifying info, ideally) and we can take a further look.
 
Old 07-25-2020, 03:44 AM   #4
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
If you're *SURE* that your firewall isn't blocking VPN on UDP 1194 (which would be the first thing to check), based on the error message it looks like the traffic is either blocked or misdirected. Do you have a firewall on your client?? Those would be first things to check is firewall on both sides. Past that, check into the "local" directive for your openVPN server config:
Code:
--local host
Local host name or IP address. If specified, OpenVPN will bind to this address only. If unspecified, OpenVPN will bind to all interfaces.
Sometimes specifying that will get things going out the right interface. Post your openvpn.conf file (sanitized of identifying info, ideally) and we can take a further look.
Both sides are CentOS boxes with the same firewalld settings. First thing I'm going to try on Monday is to set target to default of the default zone.
 
Old 07-25-2020, 09:23 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,613

Rep: Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962Reputation: 7962
Quote:
Originally Posted by THawk254 View Post
Both sides are CentOS boxes with the same firewalld settings. First thing I'm going to try on Monday is to set target to default of the default zone.
Yes, that error is typically because traffic isn't getting through (firewall) or is getting misdirected (openVPN listening on all interfaces and not routing back correctly). The 'quick-dirty-not-too-good' way to test is to disable your firewalld on both sides for a few minutes and see if things work. That narrows down things being blocked vs. server config problem.

Also, if you're running through any sort of network device/firewall (network topology things), you may have to NAT UDP on your openVPN port to the server THERE as well.
 
Old 07-27-2020, 01:27 AM   #6
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Yes, that error is typically because traffic isn't getting through (firewall) or is getting misdirected (openVPN listening on all interfaces and not routing back correctly). The 'quick-dirty-not-too-good' way to test is to disable your firewalld on both sides for a few minutes and see if things work. That narrows down things being blocked vs. server config problem.

Also, if you're running through any sort of network device/firewall (network topology things), you may have to NAT UDP on your openVPN port to the server THERE as well.
I shut down firewalld and lo and behold, it worked! But since I can't just shut down an edge firewall, how can I determine what's blocking my UDP packets. I also changed the default target of my active zone (Public) to default, as per marilyev's suggestion but I still have no packets hitting the interface.

client.conf

Quote:
client
dev tun
proto udp
remote ...
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
tls-client
ca ...
cert ...
key ...
tls-crypt ...
tls-cipher TLS-ECDHE-RSA-WITH-AES-GCM-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
auth-nocache
;comp-lzo
verb 6
server.conf

Quote:
local ...
port 1194
proto udp
dev tun
ca easyrsa/pki/ca.crt
cert easyrsa/pki/issued/server.crt
key easyrsa/pki/private/server.key
dh easyrsa/pki/dh.pem
;tls-auth ... 0
tls-crypt ...
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.20.0 255.255.255.0"
keepalive 10 120
cipher AES-256-CBC
auth SHA512
;comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 4
explicit-exit-notify 1
Current firewalld configuration (though I'm going to close the 1194/tcp port since I'm not using it.)

Quote:
public (active)
target: default
icmp-block-inversion: yes
interfaces: enp2s0
sources:
services: openvpn
ports: 1194/tcp 1194/udp
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:

Last edited by THawk254; 07-27-2020 at 01:53 AM. Reason: Added server/client config files.
 
Old 07-27-2020, 04:24 AM   #7
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
You could observe the packet filter stats on the server soon after attempting to connect from the client....
Code:
sudo iptables -vnL
Or run it live in a terminal before connecting
Code:
sudo watch iptables -vnL
then connect and observe.

That might show where the traffic is blocked (unintentionally).
 
Old 07-27-2020, 05:05 AM   #8
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
You could observe the packet filter stats on the server soon after attempting to connect from the client....
Code:
sudo iptables -vnL
Or run it live in a terminal before connecting
Code:
sudo watch iptables -vnL
then connect and observe.

That might show where the traffic is blocked (unintentionally).
will this run even if I don't have iptables running on the machine?
 
Old 07-27-2020, 05:14 AM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Firewalld is just a userspace utility. The resulting applied filter rules are run kernelspace. The iptables command allows us to examine these.
 
Old 07-27-2020, 06:04 AM   #10
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
Firewalld is just a userspace utility. The resulting applied filter rules are run kernelspace. The iptables command allows us to examine these.
Ok. I'll try that tomorrow morning.
 
Old 07-27-2020, 11:51 PM   #11
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Not quite sure what I should be looking for. Below is the result of

Code:
 iptables -vnL
:

I've removed entries that have no entries in them. But you might say I'm a total iptables noob...

Quote:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:53
0 0 ACCEPT tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
0 0 ACCEPT udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:67
0 0 ACCEPT tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:67
1795K 1773M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
2 120 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
65759 8563K INPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0
65759 8563K INPUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
830 41344 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
56938 8066K REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * virbr0 0.0.0.0/0 192.168.122.0/24 ctstate RELATED,ESTABLISHED
0 0 ACCEPT all -- virbr0 * 192.168.122.0/24 0.0.0.0/0
0 0 ACCEPT all -- virbr0 virbr0 0.0.0.0/0 0.0.0.0/0
0 0 REJECT all -- * virbr0 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- virbr0 * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
14M 14G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
126K 20M FORWARD_direct all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FORWARD_IN_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FORWARD_OUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
1171 50587 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 2490K packets, 1811M bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- * virbr0 0.0.0.0/0 0.0.0.0/0 udp dpt:68
173 20729 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
2490K 1811M OUTPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)
pkts bytes target prot opt in out source destination
126K 20M FWDI_internal all -- * * 192.168.20.0/24 0.0.0.0/0 [goto]
0 0 FWDI_trusted all -- * * 0.0.0.0/0 0.0.0.0/0 [goto] match-set sshOK src
0 0 FWDI_public all -- enp2s0 * 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDI_internal all -- enp3s0 * 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDI_trusted all -- tun0 * 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDI_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]

Chain FORWARD_OUT_ZONES (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDO_internal all -- * * 0.0.0.0/0 192.168.20.0/24 [goto]
0 0 FWDO_trusted all -- * * 0.0.0.0/0 0.0.0.0/0 [goto] match-set sshOK dst
126K 20M FWDO_public all -- * enp2s0 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDO_internal all -- * enp3s0 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDO_trusted all -- * tun0 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 FWDO_public all -- * + 0.0.0.0/0 0.0.0.0/0 [goto]

Chain FORWARD_direct (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth_int enp2s0 0.0.0.0/0 0.0.0.0/0

Chain FWDI_internal (2 references)
pkts bytes target prot opt in out source destination
126K 20M FWDI_internal_log all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FWDI_internal_deny all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FWDI_internal_allow all -- * * 0.0.0.0/0 0.0.0.0/0
2 384 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDI_public (2 references)
pkts bytes target prot opt in out source destination
0 0 FWDI_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 REJECT icmp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FWDI_trusted (2 references)
pkts bytes target prot opt in out source destination
0 0 FWDI_trusted_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_trusted_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_trusted_allow all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDO_internal (2 references)
pkts bytes target prot opt in out source destination
0 0 FWDO_internal_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDO_internal_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDO_internal_allow all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDO_public (2 references)
pkts bytes target prot opt in out source destination
126K 20M FWDO_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FWDO_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
126K 20M FWDO_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDO_public_allow (1 references)
pkts bytes target prot opt in out source destination
125K 20M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate NEW,UNTRACKED
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate NEW,UNTRACKED

Chain INPUT_ZONES (1 references)
pkts bytes target prot opt in out source destination
51747 7197K IN_internal all -- * * 192.168.20.0/24 0.0.0.0/0 [goto]
0 0 IN_trusted all -- * * 0.0.0.0/0 0.0.0.0/0 [goto] match-set sshOK src
12684 1050K IN_public all -- enp2s0 * 0.0.0.0/0 0.0.0.0/0 [goto]
1328 315K IN_internal all -- enp3s0 * 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 IN_trusted all -- tun0 * 0.0.0.0/0 0.0.0.0/0 [goto]
0 0 IN_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]

Chain IN_internal (2 references)
pkts bytes target prot opt in out source destination
53075 7512K IN_internal_log all -- * * 0.0.0.0/0 0.0.0.0/0
53075 7512K IN_internal_deny all -- * * 0.0.0.0/0 0.0.0.0/0
53075 7512K IN_internal_allow all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0

Chain IN_internal_allow (1 references)
pkts bytes target prot opt in out source destination
4 268 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
0 0 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW,UNTRACKED
7166 390K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3128 ctstate NEW,UNTRACKED

Chain IN_public (2 references)
pkts bytes target prot opt in out source destination
12684 1050K IN_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
12684 1050K IN_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
12684 1050K IN_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0
820 65216 REJECT icmp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain IN_public_allow (1 references)
pkts bytes target prot opt in out source destination
1 42 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
 
Old 07-28-2020, 12:34 AM   #12
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The output shows the tun0 interface present and the following suggests two rules for the same service
Code:
Chain IN_public_allow (1 references)
pkts bytes target prot opt in out source destination
1 42 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
The second rule never gets matched due to the first and can be removed. I note from the firewald config output that you had 'openvpn' service defined as well as port 1194 UDP explicitly. Only the former is needed.
 
Old 07-28-2020, 12:38 AM   #13
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
The output shows the tun0 interface present and the following suggests two rules for the same service
Code:
Chain IN_public_allow (1 references)
pkts bytes target prot opt in out source destination
1 42 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ctstate NEW,UNTRACKED
The second rule never gets matched due to the first and can be removed. I note from the firewald config output that you had 'openvpn' service defined as well as port 1194 UDP explicitly. Only the former is needed.
tun0 should be present on the server as openvpn@server is running.
I did add the 2nd rule (1194/udp). I should probably remove it.

but does this indicate why my client can't connect?
 
Old 07-28-2020, 01:00 AM   #14
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
It might be useful to show us
Code:
iptables -S
I wonder if masquerading is the issue here?


Just in case the following is helpful...
https://forums.openvpn.net/viewtopic.php?t=14286#p35352
 
Old 07-28-2020, 01:05 AM   #15
THawk254
LQ Newbie
 
Registered: Dec 2016
Location: Manila, Philippines
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: Disabled
Results of iptables -S

Quote:
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N FORWARD_IN_ZONES
-N FORWARD_OUT_ZONES
-N FORWARD_direct
-N FWDI_internal
-N FWDI_internal_allow
-N FWDI_internal_deny
-N FWDI_internal_log
-N FWDI_public
-N FWDI_public_allow
-N FWDI_public_deny
-N FWDI_public_log
-N FWDI_trusted
-N FWDI_trusted_allow
-N FWDI_trusted_deny
-N FWDI_trusted_log
-N FWDO_internal
-N FWDO_internal_allow
-N FWDO_internal_deny
-N FWDO_internal_log
-N FWDO_public
-N FWDO_public_allow
-N FWDO_public_deny
-N FWDO_public_log
-N FWDO_trusted
-N FWDO_trusted_allow
-N FWDO_trusted_deny
-N FWDO_trusted_log
-N INPUT_ZONES
-N INPUT_direct
-N IN_internal
-N IN_internal_allow
-N IN_internal_deny
-N IN_internal_log
-N IN_public
-N IN_public_allow
-N IN_public_deny
-N IN_public_log
-N IN_trusted
-N IN_trusted_allow
-N IN_trusted_deny
-N IN_trusted_log
-N OUTPUT_direct
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j INPUT_direct
-A INPUT -j INPUT_ZONES
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -j FORWARD_direct
-A FORWARD -j FORWARD_IN_ZONES
-A FORWARD -j FORWARD_OUT_ZONES
-A FORWARD -m conntrack --ctstate INVALID -j DROP
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A OUTPUT -o virbr0 -p udp -m udp --dport 68 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -j OUTPUT_direct
-A FORWARD_IN_ZONES -s 192.168.20.0/24 -g FWDI_internal
-A FORWARD_IN_ZONES -m set --match-set sshOK src -g FWDI_trusted
-A FORWARD_IN_ZONES -i enp2s0 -g FWDI_public
-A FORWARD_IN_ZONES -i enp3s0 -g FWDI_internal
-A FORWARD_IN_ZONES -i tun0 -g FWDI_trusted
-A FORWARD_IN_ZONES -g FWDI_public
-A FORWARD_OUT_ZONES -d 192.168.20.0/24 -g FWDO_internal
-A FORWARD_OUT_ZONES -m set --match-set sshOK dst -g FWDO_trusted
-A FORWARD_OUT_ZONES -o enp2s0 -g FWDO_public
-A FORWARD_OUT_ZONES -o enp3s0 -g FWDO_internal
-A FORWARD_OUT_ZONES -o tun0 -g FWDO_trusted
-A FORWARD_OUT_ZONES -g FWDO_public
-A FORWARD_direct -i eth_int -o enp2s0 -j ACCEPT
-A FWDI_internal -j FWDI_internal_log
-A FWDI_internal -j FWDI_internal_deny
-A FWDI_internal -j FWDI_internal_allow
-A FWDI_internal -p icmp -j ACCEPT
-A FWDI_public -j FWDI_public_log
-A FWDI_public -j FWDI_public_deny
-A FWDI_public -j FWDI_public_allow
-A FWDI_public -p icmp -j REJECT --reject-with icmp-host-prohibited
-A FWDI_trusted -j FWDI_trusted_log
-A FWDI_trusted -j FWDI_trusted_deny
-A FWDI_trusted -j FWDI_trusted_allow
-A FWDI_trusted -j ACCEPT
-A FWDO_internal -j FWDO_internal_log
-A FWDO_internal -j FWDO_internal_deny
-A FWDO_internal -j FWDO_internal_allow
-A FWDO_public -j FWDO_public_log
-A FWDO_public -j FWDO_public_deny
-A FWDO_public -j FWDO_public_allow
-A FWDO_public_allow -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A FWDO_public_allow -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A FWDO_trusted -j FWDO_trusted_log
-A FWDO_trusted -j FWDO_trusted_deny
-A FWDO_trusted -j FWDO_trusted_allow
-A FWDO_trusted -j ACCEPT
-A INPUT_ZONES -s 192.168.20.0/24 -g IN_internal
-A INPUT_ZONES -m set --match-set sshOK src -g IN_trusted
-A INPUT_ZONES -i enp2s0 -g IN_public
-A INPUT_ZONES -i enp3s0 -g IN_internal
-A INPUT_ZONES -i tun0 -g IN_trusted
-A INPUT_ZONES -g IN_public
-A IN_internal -j IN_internal_log
-A IN_internal -j IN_internal_deny
-A IN_internal -j IN_internal_allow
-A IN_internal -p icmp -j ACCEPT
-A IN_internal_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A IN_internal_allow -d 224.0.0.251/32 -p udp -m udp --dport 5353 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A IN_internal_allow -p tcp -m tcp --dport 3128 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A IN_public -j IN_public_log
-A IN_public -j IN_public_deny
-A IN_public -j IN_public_allow
-A IN_public -p icmp -j REJECT --reject-with icmp-host-prohibited
-A IN_public_allow -p udp -m udp --dport 1194 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A IN_public_allow -p udp -m udp --dport 1194 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A IN_trusted -j IN_trusted_log
-A IN_trusted -j IN_trusted_deny
-A IN_trusted -j IN_trusted_allow
-A IN_trusted -j ACCEPT
-A IN_trusted_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Unable to connect to OpenVPN server on current. Also, unable to build NetworkManager-openvpn The_Dark_Passenger Slackware 2 07-19-2019 05:51 PM
OpenVPN assigning public & static IPs to pcs/devices behind an OpenVPN client dgonzalezh Linux - Networking 6 07-18-2010 09:50 AM
Able to connect via SSH but not able to connect via web port 80 Orange Sunshine Linux - Server 9 04-03-2010 07:11 PM
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
Not able to connect client with openvpn pawan_lal Linux - Server 1 12-08-2009 04:39 PM

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

All times are GMT -5. The time now is 08:17 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