OCI – How To Open Network Ports in Ubuntu
Applies to:
Oracle Cloud Infrastructure
Linux x86-64
Goal:
In OCI Ubuntu instances (image Ubuntu-22.04) opening anetwork port in UFW don’t work.
Solution:
Note: Ubuntu images based on 24.04 no longer are provisioned with UFW
Ubuntu 22.04 uses nftableas abackend for UFW.
OCI Ubuntu images are provided witha set of iftables, necessary to guarantee OCI functionality.
If an access to a new network port needs to be opened, it must be opened in UFW but also in iptables.
For example, to open RDP port on a Linux instance, run:
1) UFW:
$ ufw allow 3389/tcp
2) To open the port in iptables:
$ iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT
Tagged:
0