vasten
Posts: 2
Joined: Mon Sep 25, 2023 6:11 am

MASQERADE file not found

Mon Sep 25, 2023 6:18 am

Tried both debian bullseye and debian Buster

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

returns CHAIN 'MASQERADE' does not exist

switching to legacy with

sudo update-alternatives --config iptables

it returns Couldn't load target 'MASQERADE': No such file or directory

following this tutorial
https://github.com/garyexplains/example ... _router.md

this thread says just use a fresh install of buster.. that does not work.. still get no such file or directory
viewtopic.php?t=273231

pidd
Posts: 5163
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: MASQERADE file not found

Mon Sep 25, 2023 2:29 pm

RPiOS is actually using nftables and iptables compatibility mode/module or whatever.

You have a choice of reverting to iptables-legacy which will probably come back to bite you in the future or going along with nftables.

Take your pick

Code: Select all

update-alternatives --set iptables /usr/sbin/iptables-legacy

Code: Select all

nft add rule nat postrouting masquerade

User avatar
jojopi
Posts: 3860
Joined: Tue Oct 11, 2011 8:38 pm

Re: MASQERADE file not found

Mon Sep 25, 2023 4:02 pm

vasten wrote:
Mon Sep 25, 2023 6:18 am
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

[but]
CHAIN 'MASQERADE' does not exist
Couldn't load target 'MASQERADE': No such file or directory
Where are the misspellings coming from? Those are expected errors if there is a typo in the target name.

Original command works for me with both nft and legacy.

Return to “Raspberry Pi OS”