This is really a routing question but here is the back ground:
I am running Ubuntu 20.04.3 LTS with UFW. My internal network is 10.126.1.0/24. No inbound translations at the Internet edge.
If I inspect my UFW logs I see messages similar to this:
Aug 20 17:41:01 XPS-8100 kernel: [ 1964.382883] [UFW BLOCK] IN=enp5s0 OUT= MAC=84:2b:2b:9d:ae:44:02:81:51:8b:22:18:08:00 SRC=142.250.111.109 DST=10.126.1.41 LEN=85 TOS=0x00 PREC=0x00 TTL=36 ID=11413 PROTO=TCP SPT=993 DPT=40634 WINDOW=266 RES=0x00 ACK PSH URGP=0
If I am reading this right, IP tables/UFW is blocking inbound traffic from 142.250.111.109 to 10.126.1.41. My confusion stems from IP traffic from a public IP address delivered to a private IP address then being (happily) denied.
Unless I badly misunderstand the routing rules for the public Internet, no self respecting ISP will carry traffic for private addresses much less find one of the thousands of instances of private IP addresses then deliver the traffic.
Either UFW is confused or I am confused or the Internet is doing something I didn't expect. Anyone have any thoughts?
UFW status returns this list of ports open on the Ubuntu machine:
(base) glenn@XPS-8100:~/Desktop$ sudo ufw status
Status: active
To Action From
-- ------ ----
137/udp ALLOW 10.126.1.0/24
138/udp ALLOW 10.126.1.0/24
139/tcp ALLOW 10.126.1.0/24
445/tcp ALLOW 10.126.1.0/24
514/tcp ALLOW 10.126.1.0/24
514/udp ALLOW 10.126.1.0/24
22/tcp ALLOW 10.126.1.0/24
5001/tcp ALLOW 10.126.1.0/24
5001/udp ALLOW 10.126.1.0/24
137/tcp ALLOW 10.126.1.0/24
139/udp ALLOW 10.126.1.0/24
80/tcp ALLOW 10.126.1.0/24
8080/tcp ALLOW 10.126.1.0/24
5201 ALLOW 10.126.1.0/24