LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-26-2020, 01:12 AM   #1
avian
Member
 
Registered: Aug 2014
Posts: 31

Rep: Reputation: Disabled
iptables change in -current, whats new --to-source equivalent?


Since one of the newer -current updates, an iptables SNAT command I usually use on start up seems to have gone awry.

Code:
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth5 -j SNAT --to-source 1.2.3.4
now gives the error -:


Code:
iptables v1.8.5 (legacy): unknown option "--to-source"
Try `iptables -h' or 'iptables --help' for more information.

So my question is.... whats the latest most acceptable way to pass the command without using the --to-source option?
 
Old 06-26-2020, 01:51 AM   #2
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 182

Rep: Reputation: 107Reputation: 107
I've newer used "--to-source" in SNAT. From forever I use "--to". I have no idea what is the difference between them, but NAT works for me with "--to".
So check if this:
Code:
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth5 -j SNAT --to 1.2.3.4
also works for you.
 
Old 06-26-2020, 01:55 AM   #3
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers) / Ubuntu (workstations)
Posts: 185

Rep: Reputation: 118Reputation: 118
It works for me!
https://manpages.debian.org/unstable...ions.8.en.html
https://www.netfilter.org/documentat...T-HOWTO-6.html

In my case:
Code:
# with SNAT for static external IP address
  $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to-source $EXTIP
 
Old 06-26-2020, 01:55 AM   #4
avian
Member
 
Registered: Aug 2014
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Labinnah View Post
I've newer used "--to-source" in SNAT. From forever I use "--to". I have no idea what is the difference between them, but NAT works for me with "--to".
So check if this:
Code:
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth5 -j SNAT --to 1.2.3.4
also works for you.
Unfortunately I tried this a few minutes ago. Pretty much the same error. So weird.

Code:
iptables v1.8.5 (legacy): unknown option "--to"
Try `iptables -h' or 'iptables --help' for more information.
 
Old 06-26-2020, 02:01 AM   #5
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 182

Rep: Reputation: 107Reputation: 107
Maybe you don't load required kernel modules? It can be, I'm guessing, "iptable_nat" and "nf_nat_ipv4". This can be caused that you upgraded kernel package but didn't upgraded kernel modules package.
 
1 members found this post helpful.
Old 06-26-2020, 02:15 AM   #6
avian
Member
 
Registered: Aug 2014
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Labinnah View Post
Maybe you don't load required kernel modules? It can be, I'm guessing, "iptable_nat" and "nf_nat_ipv4". This can be caused that you upgraded kernel package but didn't upgraded kernel modules package.
Exactly what it was. Just came back from the last reboot.

I traced it down to my move from kernel 5.7.2 to 5.7.5. Which had me shaking my head cause the .config files were identical (apart from the mention of kernel version).

Then I realised...... I forgot to run make modules_install .. So embarrasing. I'm going to go hide in a corner for a while.
 
Old 06-28-2020, 10:55 AM   #7
Stuferus
Member
 
Registered: Jun 2013
Location: Germany
Distribution: Slackware
Posts: 168

Rep: Reputation: Disabled
i guess its time to move to nftables and forget iptables..
 
Old 06-28-2020, 12:02 PM   #8
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers) / Ubuntu (workstations)
Posts: 185

Rep: Reputation: 118Reputation: 118
Or maybe we can jump directly to bpfilter!
https://linux-audit.com/bpfilter-nex...inux-firewall/
https://medium.com/@ugendreshwarkudu...ne-5f7dc63ebc3
 
1 members found this post helpful.
  


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
Whats the Linux equivalent of Active Directory? maples Linux - General 4 08-07-2015 10:31 AM
slackpkg -current. Whats going to happen? Twister512 Slackware 5 04-06-2010 01:41 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Whats the equivalent on Linux for /var/adm/syslog? eDubster Linux - General 5 05-15-2003 08:02 PM

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

All times are GMT -5. The time now is 07:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration