LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-25-2022, 04:50 AM   #1
HaroldSch
LQ Newbie
 
Registered: Feb 2022
Posts: 10

Rep: Reputation: 1
Need assistance in determining next step in troubleshooting - PC utilized as firewall/ip forwarding


I am unclear as to how to begin to troubleshoot an issue I am seeing under Slackware 15.0 x64.

I use a dedicated PC to provide IP Forwarding, DHCPD and Firewall services for my home. All communications with the outside world go through this PC. Lets call this PC#1. PC#1 has Slackware 14.2 x64 installed on it with all of the latest updates. I have a second PC, identical hardware as PC#1, that has Slackware 15.0 x64 installed on it again with all of the latest updates. Lets call this PC#2.

My child uses Google classroom to participate in online school. With PC#1 connected to my network, normal two-way video and audio communications between the teacher and my child are possible. When I replace PC#1 with PC#2, the video that is generated locally does not make it to the teacher. The teacher sees a blank screen. My child is able to see video received from the teacher. Audio continues to behave normally, that is the teacher and my child are able to communicate verbally.

For PC#1 and PC#2 I am able to use identical initialization scripts, except for rc.inet1.conf which has updated formatting. For the Firewall services, I utilize Shorewall with the same scipts for both PC's.

If anyone is able to provide some insight as to a next step in troubleshooting, I'd greatly appreciate it!

Thank you.
 
Old 03-25-2022, 10:28 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
I'll bet this is a NAT helper issue.

If you're still running the stock Slackware 4.4.x kernel on the 14.2 system, the NAT helpers are automatically bound. All you need to do is load the modules, and the traffic will be covered by any RELATED rule.

I don't know exactly in which kernel version this was changed; I believe it was around 4.7. I remember having to modify my firewall script because FTP stopped working.

Anyway, as 15.0 uses a much more recent kernel, NAT helpers simply won't work automatically. Protocol helpers have to be specified explicitly by firewall rules in order for "RELATED" traffic to be correctly identified and handled.

Try manually adding conntrack ("-j CT") rules for the relevant protocols to the PREROUTING chain of the raw table. For video conferencing this is likely to be H.323 or SIP:
Code:
iptables -t raw -I PREROUTING 1 -p udp --dport 1719 -j CT --helper RAS
iptables -t raw -I PREROUTING 2 -p tcp --dport 1720 -j CT --helper Q.931
iptables -t raw -I PREROUTING 3 -p udp --dport 5060 -j CT --helper sip
This should work even if you already have an active ShoreWall ruleset. Also, make sure the nf_nat_323 and nf_nat_sip modules are are loaded.
 
Old 03-27-2022, 05:09 AM   #3
dodoLQ
Member
 
Registered: Dec 2014
Location: France
Distribution: Slackware
Posts: 213

Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
I don't know exactly in which kernel version this was changed; I believe it was around 4.7. I remember having to modify my firewall script because FTP stopped working.
Can you post an example of iptable rules for doing FTP? I've a same pb here since switching to 15.0.. Thanks.
 
Old 03-27-2022, 05:26 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by dodoLQ View Post
Can you post an example of iptable rules for doing FTP?
The FTP control channel uses TCP/21, and the helper module is simply called "ftp":
Code:
iptables -t raw -A PREROUTING -p tcp --dport 21 -j CT --helper ftp
 
Old 03-27-2022, 05:55 AM   #5
HaroldSch
LQ Newbie
 
Registered: Feb 2022
Posts: 10

Original Poster
Rep: Reputation: 1
Thank you so much for your input.

I can confirm that Ser Olmy's assessment is correct. It's definitely missing NAT Helper's. The issue seems to be with shorewall's initialization after first install.

Using 'shorewall show capabilities' under Slackware 14.2 x64 produces a list of available kernel/iptables capabilities. Under 15.0 x64 I would get an error message and no list. After some testing, I was able to get a valid list of available kernel/iptables capabilities under 15.0 x64 but at this moment I am unable to clearly define why. I will continue my testing and get back to you.

Last edited by HaroldSch; 03-27-2022 at 05:57 AM.
 
Old 03-27-2022, 06:25 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
A small clarification: While NAT is almost certainly involved in your scenario, you'd actually have issues even in cases where no NAT was being performed.

The problem is a lack of protocol-specific connection tracking in the firewall, also known as Application Level Gateways (ALGs). These software modules inspect network traffic on the application level, and will dynamically create and destroy firewall rules to allow related traffic, such as an FTP data connection or a SIP RTP session.

These ALGs may also perform NAT-related tasks, such as altering references to IP addresses and ports. In the Linux kernel, the connection tracking modules are separate from the NAT modules, but the latter depends on the former.
 
Old 03-27-2022, 08:16 AM   #7
HaroldSch
LQ Newbie
 
Registered: Feb 2022
Posts: 10

Original Poster
Rep: Reputation: 1
Thank you for the clarification! This is starting to make sense now.

When I woke up this morning and checked my 14.2 x64 box with the command 'shorewall show capabilities' I received the error message "ERROR: Chain 'capabilities' is not recognized by /usr/sbin/iptables." This is the same message I received on my 15.0 x64 installation. When there was no requirement to handle any special protocols, the chain did not exist.

Under 15.0 x64, if I don't start shorewall upon bootup, I can get a valid response for 'shorewall show capabilities'. Starting shorewall after receiving the valid response and doing a video test however still does not give me video. The connection tracking modules are loaded. 'lsmod' displays them.

Last edited by HaroldSch; 03-27-2022 at 09:02 AM.
 
Old 03-27-2022, 08:54 AM   #8
HaroldSch
LQ Newbie
 
Registered: Feb 2022
Posts: 10

Original Poster
Rep: Reputation: 1
Update

'lsmod' lists the connection tracking modules that are loaded. Between the two boxes I'm not seeing an obvious difference/omission.
'shorewall show capabilities' displays my kernel/iptables capabilities. The 5.15.27 Kernel has more capabilities but again I'm not seeing any obvious omissions.

Yet for some reason under Slackware 15.0 x64 the connection tracking modules + shorewall are dropping video packets. I'm trying to create a log of this but a lot of information is generated in a very short period of time.

Last edited by HaroldSch; 03-27-2022 at 06:34 PM.
 
Old 03-30-2022, 11:41 AM   #9
dodoLQ
Member
 
Registered: Dec 2014
Location: France
Distribution: Slackware
Posts: 213

Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Code:
iptables -t raw -A PREROUTING -p tcp --dport 21 -j CT --helper ftp
Hi Ser Olmy Can you adapt these rules please (i'm totally noob in iptables /o\)? Thank you.
Code:
iptables -A INPUT -i eth0 --protocol tcp --source-port 21 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 --protocol tcp --source-port 20 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 20 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 --protocol tcp --source-port 1024:65535 --destination-port 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --source-port 1024:65535 --destination-port 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
 
Old 03-31-2022, 05:02 AM   #10
HaroldSch
LQ Newbie
 
Registered: Feb 2022
Posts: 10

Original Poster
Rep: Reputation: 1
Update:

So I changed the rc.firewall script to the follow:

/sbin/modprobe ipt_MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Essentially making a simple router out of the PC#2.

The results were the same. Google Meet video is lost through the box. So that tells me shorewall is not the cause.

My guess is it's the kernel that's causing this. Time to do some more research.
 
Old 03-31-2022, 06:04 AM   #11
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by HaroldSch View Post
My guess is it's the kernel that's causing this. Time to do some more research.
Yes, that's what I said in my first reply.

You need to make sure the relevant "conntrack" and "NAT" modules are loaded, AND either create firewall rules in the "raw" table to activate connection tracking (and NAT helpers) for the relevant protocols, OR specifically re-enable the old behaviour where conntrack helper modules are enabled by default:
Code:
echo 1 > /proc/sys/net/netfilter/nf_conntrack_helper
 
Old 04-30-2022, 04:14 AM   #12
dodoLQ
Member
 
Registered: Dec 2014
Location: France
Distribution: Slackware
Posts: 213

Rep: Reputation: Disabled
Now mc works with ftp & iptables

Hehe
Code:
iptables -A INPUT -i eth0 --protocol tcp --source-port 21 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 21 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 --protocol tcp --source-port 20 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 20 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 --protocol tcp --source-port 1024:65535 --destination-port 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 --protocol tcp --source-port 1024:65535 --destination-port 1024:65535 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with oom-killer on SuSE Server - request assistance in determining cause EnderX Linux - General 8 08-06-2012 04:15 PM
Step by step assistance on Linux Ockie Linux - Newbie 1 05-18-2004 05:56 PM
I need to upgrade to a recent Squid version, I need a Step by step procedure mfeoli Linux - Newbie 4 01-14-2004 10:14 AM
memory not being utilized wendy Linux - Newbie 6 04-15-2003 03:05 PM
How much memory is utilized? Manish Linux - Newbie 2 02-23-2002 05:48 PM

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

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