0

I have not used iptables before aside from following pre-made instructions, so I am expecting that I've overlooked something basic!

I've applied the below rule, but when trying to look it up it is not listed and is not working as expected.

sudo iptables -t nat -A OUTPUT -p tcp --dport 21 -j DNAT --to-destination :1982
sudo reboot

The firewall is setup at the gateway level (Azure firewall), but on my Ubuntu Server VM I haven't previously added any rules and ufw is not enabled. At the gateway I've added port 21 in addition to 1982 to be allowed through. PureFTP is configured and connectable on port=1982. However, it is not forwarding 21 to 1982 as expected. The goal is for both ports to work to support 21 now in addition to legacy 1982.

I have tried listing commands to look and see if it didn't save, for example this returns showing no rules under any categories:

iptables -t nat -L --line-numbers -n

Do I need to enable anything else or is my rule just not being saved?

Steve Seeger
  • 119
  • 1
  • 5

1 Answers1

0

Ubuntu 18.04 does not install the iptables-persistent package by default as far as I'm aware. Please look at the first answer of https://askubuntu.com/questions/1052919/iptables-reload-restart-on-ubuntu-18-04 to see if it solves your problem.

marfrit
  • 1
  • 3