I have host machine 20.04 and guest VM box 22.04
I am trying to run the curl command and on both machine getting the same error.
Host running this:
sudo ufw status
Status: active
To Action From
-- ------ ----
5000:5100/tcp ALLOW Anywhere
1433 ALLOW Anywhere
1434 ALLOW Anywhere
8080 ALLOW Anywhere
OpenSSH ALLOW Anywhere
80/tcp ALLOW Anywhere
80 ALLOW 127.0.0.1
5000:5100/tcp (v6) ALLOW Anywhere (v6)
1433 (v6) ALLOW Anywhere (v6)
1434 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
and yes there are repeated rules but I was getting the same error even before.
I have tried a combination of curl with localhost or 127.0.0.1 or :80 or :8080 and still got a similar error
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused
sudo netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:1434 0.0.0.0:* LISTEN 1514/sqlservr
tcp 0 0 127.0.0.1:1431 0.0.0.0:* LISTEN 1514/sqlservr
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 200812/cupsd
tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 1169/mysqld
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1169/mysqld
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 923/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1121/sshd: /usr/sbi
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 1514/sqlservr
tcp6 0 0 ::1:631 :::* LISTEN 200812/cupsd
tcp6 0 0 ::1:1431 :::* LISTEN 1514/sqlservr
tcp6 0 0 ::1:1434 :::* LISTEN 1514/sqlservr
tcp6 0 0 :::22 :::* LISTEN 1121/sshd: /usr/sbi
tcp6 0 0 :::1433 :::* LISTEN 1514/sqlservr
udp 0 0 127.0.0.53:53 0.0.0.0:* 923/systemd-resolve
udp 0 0 0.0.0.0:631 0.0.0.0:* 200814/cups-browsed
udp 0 0 0.0.0.0:54075 0.0.0.0:* 987/avahi-daemon: r
udp 0 0 224.0.0.251:5353 0.0.0.0:* 22568/chrome
udp 0 0 224.0.0.251:5353 0.0.0.0:* 22612/chrome --type
udp 0 0 0.0.0.0:5353 0.0.0.0:* 987/avahi-daemon: r
udp6 0 0 :::55564 :::* 987/avahi-daemon: r
udp6 0 0 :::5353 :::*
Also here I got nothing when trying to see if port 80 or 8080 is listen
sudo netstat -tnlp | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1121/sshd: /usr/sbi
tcp6 0 0 :::22 :::* LISTEN 1121/sshd: /usr/sbi
uss:~$ sudo netstat -tnlp | grep :80
uss:~$ sudo netstat -tnlp | grep :8080