Score:0

Closed ports in ubuntu server 20.04

za flag

I have a Ubuntu server 20.04 machine with 2 ethernet interfaces (and I use it also as a router). A made some ufw rules to open some ports, but... they open only on the internal interface (enp4s0), and not on an external one (enp3s0)?!?!

Even when I disable the ufw and did not load iptables rules it is the same. I use ssh on a specific port 2096, I can connect from internal network, but can not connect from outside. Only port 80 is open on a external-enp3s0 interface?!?

[ 1] 2096/tcp ALLOW IN Anywhere
[ 2] 80 ALLOW IN Anywhere
[ 3] 443 ALLOW IN Anywhere
[ 4] 51413 ALLOW IN Anywhere
[ 5] 9091 ALLOW IN Anywhere
[ 6] 2096 on enp3s0 ALLOW IN Anywhere
[ 7] 51413 on enp3s0 ALLOW IN Anywhere
[ 8] 2096/tcp (v6) ALLOW IN Anywhere (v6)
[ 9] 80 (v6) ALLOW IN Anywhere (v6)
[10] 443 (v6) ALLOW IN Anywhere (v6)
[11] 51413 (v6) ALLOW IN Anywhere (v6)
[12] 9091 (v6) ALLOW IN Anywhere (v6)
[13] 2096 (v6) on enp3s0 ALLOW IN Anywhere (v6)
[14] 51413 (v6) on enp3s0 ALLOW IN Anywhere (v6)

za flag
I did not understand you. This Ubuntu machine is my router. And how it decides to applay ufw rules to one interface, and not to the other - this is the question. And of cource - how to solve it. Because I need these ports open to use it as a sftp file server. P.S. I tried to connect to port 2096 from outside without success, so the port is realy closed.
hr flag
Apologies - I missed that part. Please ignore my previous comment.
Doug Smythies avatar
gn flag
Is enp3s0 connected directly to internet or is there something between it and internet? i.e. is port forwarding required? If you run tcpdump (or wireshark, if you prefer) on enp3s0 do you see packets arriving and leaving via port 2096 when you try to ssh in from outside? `sudo tcpdump -n -tttt -i enp3s0 port 2096`
za flag
Thank you for the answers. It was my mistake.I installed ssh-server, transmission-daemon and some other software and till I tight up the security I put them to listen to INTERNAL network ONLY. So on the external ports there were nothing to listen and the ports were reported "closed". Now evering is OK. Problem solved.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.