Hide Forgot
RHEL7 is missing an SELinux rule that would allow OpenVPN to bind to a UDP socket: *** module ovpn 2.0; require { type reserved_port_t; class udp_socket name_bind; } #============= openvpn_t ============== allow openvpn_t reserved_port_t:udp_socket name_bind; *** I would like to know if it's possible to integrate this rule on the package that ships from EPEL7.
What port are you trying to bind to? The default port 1194 is labeled openvpn_port_t and openvpn should be able to use it. If you want to use a different port you need to do: semanage port --add -t openvpn_port_t -p udp <port>
So there is an inconsistency here. We use port 443 to avoid issues with random firewalls. The TCP daemon loads fine, out of the box, without any SELinux modifications. However for UDP I had to run the semanage rule above. It would be good if UDP was allowed to use 443 by default, just like TCP is.
If you are going to use a different port than the standard one you are going to need to make selinux modifications. These are the standard ports: # semanage port -l | grep openvpn openvpn_port_t tcp 1194 openvpn_port_t udp 1194 443 is the standard port for https, so: # semanage port -l | grep 443 http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 I'm reassigning to the selinux folks to see what is up with TCP working. But the UDP behavior is as expected.
Ok we don't support this labeling in the policy. I believe the best solution for this local modification is a local change using semanage how Orion wrote above. semanage port --add -t openvpn_port_t -p udp <port> Thank you.