LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 07-07-2020, 01:46 PM   #1
williamk7
LQ Newbie
 
Registered: Jul 2020
Posts: 4

Rep: Reputation: Disabled
Firewalld allowing traffic between main interface and OpenVPN tun0


Hi,

New to firewalld and centos. Firewalld is blocking traffic between openvpn tunnel and my main network. In logs I see:
"[335548.930116] FINAL_REJECT: IN=enp3s0 OUT=tun0 SRC=192.168.113.5 DST=172.16.200.11 LEN=60 TOS=0x00 PREC=0x00 TTL=62 ID=48188 DF PROTO=TCP SPT=53044 DPT=80 WINDOW=64240 RES=0x00 SYN URGP=0

So I added Rich rule to allow traffic between 192.168.113.5 and 172.16.200.11:

firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=192.168.113.5/32 destination address=172.16.200.11/32 port port=80 protocol=tcp accept'

But still being blocked. My firewalld status looks like this:
#firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp3s0 tun0
sources:
services: cockpit dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="192.168.113.5/32" destination address="172.16.200.11/32" port port="80" protocol="tcp" accept

What am I doing wrong?
 
Old 07-07-2020, 03:54 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Do you have forwarding enabled?
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
 
Old 07-08-2020, 04:02 PM   #3
williamk7
LQ Newbie
 
Registered: Jul 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes, forwarding is enabled.
 
Old 07-08-2020, 04:44 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Perhaps share
Code:
iptables -S
 
Old 07-08-2020, 06:22 PM   #5
williamk7
LQ Newbie
 
Registered: Jul 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
 
Old 07-08-2020, 09:06 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
No active firewall?
 
Old 07-09-2020, 10:21 AM   #7
williamk7
LQ Newbie
 
Registered: Jul 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes, it is centos so it uses firewalld/nftables instead of iptables. So I think the equivalent of iptables -S is #firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp3s0 tun0
sources:
services: cockpit dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="192.168.113.5/32" destination address="172.16.200.11/32" port port="80" protocol="tcp" accept
 
Old 07-09-2020, 03:36 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
No, that is not the equivalent. It merely shows the firewalld config.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
(OpenVPN) Route one user's traffic into tun0 with iptables Märk Owen Linux - Networking 0 05-20-2015 08:45 PM
Force all internet traffic through tun0 (Vpn Interface) dschuett Linux - Security 3 08-10-2011 08:36 AM
Force all internet traffic through tun0 (Vpn Interface) dschuett Linux - Security 2 08-10-2011 12:24 AM
iptables question with OpenVPN (tun0 to tun0 filtering) fang0654 Linux - Server 3 09-30-2009 02:17 AM
Iptables/TC: how to make masqueraded traffic go through an openVPN tun0? theVOID Linux - Networking 3 04-25-2008 03:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:59 AM.

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