I have two servers running 18.04.6 desktop.
I am unable to access them from a different subnet (IPsec site to VPN).
It appears to me that the built-in firewall doesn’t allow connections from an address outside the range of it’s subnet.
I can access Windows PCs and a QNAP NAS so I think the default firewall settings in the Ubuntu servers are the problem.
Note: both servers have multiple VLAN interfaces and the subnet I am trying to reach is a VLAN.
Ufw rules
root@ns04:~# ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] Anywhere ALLOW IN 192.168.3.0/24
[ 2] Anywhere ALLOW IN 192.168.1.0/24
[ 3] Anywhere ALLOW IN 172.30.13.0/24
[ 4] Samba ALLOW IN Anywhere
[ 5] Bind9 ALLOW IN Anywhere
[ 6] 22/tcp ALLOW IN Anywhere
[ 7] 67 ALLOW IN Anywhere
[ 8] 68 ALLOW IN Anywhere
[ 9] Anywhere ALLOW OUT Anywhere (out)
[10] Samba (v6) ALLOW IN Anywhere (v6)
[11] Bind9 (v6) ALLOW IN Anywhere (v6)
[12] 22/tcp (v6) ALLOW IN Anywhere (v6)
[13] 67 (v6) ALLOW IN Anywhere (v6)
[14] 68 (v6) ALLOW IN Anywhere (v6)
[15] Anywhere (v6) ALLOW OUT Anywhere (v6) (out)
root@ns04:~#
Ip ad
ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.3.254/24 brd 172.30.3.255 scope global dynamic enp2s0
valid_lft 137844sec preferred_lft 137844sec
inet6 wwww:xxxx:yyyy:zzzz:403a:fcea:711c:8530/64 scope global temporary dynamic
valid_lft 86231sec preferred_lft 14231sec
inet6 wwww:xxxx:yyyy:zzzz:e135:7f9c:b29f:5abf/64 scope global temporary deprecated dynamic
valid_lft 86231sec preferred_lft 0sec
inet6 wwww:xxxx:yyyy:zzzz:9c9d:ad17:ea63:bfdb/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86231sec preferred_lft 14231sec
inet6 fe80::4504:f36d:fb1b:907a/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: enp2s0.4@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.4.254/24 brd 172.30.4.255 scope global enp2s0.4
valid_lft forever preferred_lft forever
inet6 wwww:xxxx:yyyy:zzz4:7584:e7fc:17b4:ea5e/64 scope global temporary dynamic
valid_lft 86339sec preferred_lft 14339sec
inet6 wwww:xxxx:yyyy:zzz4:c0f0:42d3:9869:5852/64 scope global temporary deprecated dynamic
valid_lft 86339sec preferred_lft 0sec
inet6 wwww:xxxx:yyyy:zzz4:201:2eff:fe6b:2fe7/64 scope global dynamic mngtmpaddr
valid_lft 86339sec preferred_lft 14339sec
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
4: enp2s0.5@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.5.254/24 brd 172.30.5.255 scope global enp2s0.5
valid_lft forever preferred_lft forever
inet6 wwww:xxxx:yyyy:zzz5:b89d:2a36:bdd4:65ff/64 scope global temporary dynamic
valid_lft 86080sec preferred_lft 14080sec
inet6 wwww:xxxx:yyyy:zzz5:1991:2647:2778:79b/64 scope global temporary deprecated dynamic
valid_lft 86080sec preferred_lft 0sec
inet6 wwww:xxxx:yyyy:zzz5:201:2eff:fe6b:2fe7/64 scope global dynamic mngtmpaddr
valid_lft 86080sec preferred_lft 14080sec
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
5: enp2s0.7@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.7.254/24 brd 172.30.7.255 scope global enp2s0.7
valid_lft forever preferred_lft forever
inet6 wwww:xxxx:yyyy:zzz7:502:cf3d:1526:2907/64 scope global temporary dynamic
valid_lft 86111sec preferred_lft 14111sec
inet6 wwww:xxxx:yyyy:zzz7:2475:a5f6:3698:3f44/64 scope global temporary deprecated dynamic
valid_lft 86111sec preferred_lft 0sec
inet6 wwww:xxxx:yyyy:zzz7:201:2eff:fe6b:2fe7/64 scope global dynamic mngtmpaddr
valid_lft 86111sec preferred_lft 14111sec
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
6: enp2s0.8@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.8.254/24 brd 172.30.8.255 scope global enp2s0.8
valid_lft forever preferred_lft forever
inet6 fdea:0:0:8::254/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
7: enp2s0.9@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.9.254/24 brd 172.30.9.255 scope global enp2s0.9
valid_lft forever preferred_lft forever
inet6 wwww:xxxx:yyyy:zzz9:896e:cbd5:e835:a490/64 scope global temporary dynamic
valid_lft 86099sec preferred_lft 14099sec
inet6 wwww:xxxx:yyyy:zzz9:edae:d6e7:6503:e08a/64 scope global temporary deprecated dynamic
valid_lft 86099sec preferred_lft 0sec
inet6 wwww:xxxx:yyyy:zzz9:201:2eff:fe6b:2fe7/64 scope global dynamic mngtmpaddr
valid_lft 86099sec preferred_lft 14099sec
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
8: enp2s0.10@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.10.254/24 brd 172.30.10.255 scope global enp2s0.10
valid_lft forever preferred_lft forever
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
9: enp2s0.11@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.11.254/24 brd 172.30.11.255 scope global enp2s0.11
valid_lft forever preferred_lft forever
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
10: enp2s0.12@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:01:2e:6b:2f:e7 brd ff:ff:ff:ff:ff:ff
inet 172.30.12.254/24 brd 172.30.12.255 scope global enp2s0.12
valid_lft forever preferred_lft forever
inet6 fe80::201:2eff:fe6b:2fe7/64 scope link
valid_lft forever preferred_lft forever
root@ns04:/etc/ufw#
Ip route
root@ns04:/etc/ufw#
root@ns04:/etc/ufw# ip route
default via 172.30.3.1 dev enp2s0
default via 172.30.3.1 dev enp2s0 proto dhcp metric 20100
169.254.0.0/16 dev enp2s0.4 scope link metric 1000
172.30.3.0/24 dev enp2s0 proto kernel scope link src 172.30.3.254
172.30.3.0/24 dev enp2s0 proto kernel scope link src 172.30.3.254 metric 100
172.30.4.0/24 dev enp2s0.4 proto kernel scope link src 172.30.4.254
172.30.5.0/24 dev enp2s0.5 proto kernel scope link src 172.30.5.254
172.30.7.0/24 dev enp2s0.7 proto kernel scope link src 172.30.7.254
172.30.8.0/24 dev enp2s0.8 proto kernel scope link src 172.30.8.254
172.30.9.0/24 dev enp2s0.9 proto kernel scope link src 172.30.9.254
172.30.10.0/24 dev enp2s0.10 proto kernel scope link src 172.30.10.254
172.30.11.0/24 dev enp2s0.11 proto kernel scope link src 172.30.11.254
172.30.12.0/24 dev enp2s0.12 proto kernel scope link src 172.30.12.254
root@ns04:/etc/ufw#
Notes:
192.168.1.0/24 is the remote site
172.30.5.0/24 is the local vlan subnet remote connects to.
The other two /24s are for local testing
It appears I need changes in the ufw before file to either ufw-not-local and/or ufw-before-input.
# all other non-local packets are dropped
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP
I need to make samba work from 192.168.1.0/24.
SSH and ping would also be helpful
scan of the subnet
Generated by Angry IP Scanner 3.7.6
https://angryip.org
Scanned 172.30.5.0 - 172.30.5.255
Jan 10, 2022 2:39:16 PM
IP Ping Hostname Ports NetBIOS Info MAC Address MAC Vendor
172.30.5.1 4 ms router.home.test 80,443 [n/a] [n/a] [n/a]
172.30.5.8 4 ms 3n008.home.test 80,443,8080 [n/a] [n/a] [n/a]
172.30.5.27 6 ms tp-share 80,443 WORKGROUP\TP-SHARE@TP-SHARE [00-00-00-00-00-00][n/a] [n/a]
172.30.5.28 3 ms 3n028.home.test 80 [n/a] [n/a] [n/a]
172.30.5.128 3 ms 3n128.home.test 80 [n/a] [n/a] [n/a]
172.30.5.135 3 ms 3n135.home.test 80 [n/a] [n/a] [n/a]
172.30.5.139 7 ms 3n139.home.test [n/a] [n/a] [n/a] [n/a]
172.30.5.165 6 ms 3n165.home.test 80,443 [n/a] [n/a] [n/a]
172.30.5.166 4 ms 3n166.home.test 80,443 [n/a] [n/a] [n/a]
172.30.5.170 6 ms 3n170.home.test [n/a] [n/a] [n/a] [n/a]
172.30.5.177 3 ms 3n177.home.test 80 [n/a] [n/a] [n/a]
172.30.5.196 3 ms sq05.home.test 80,443,8080 WORKGROUP\SQ05@SQ05 [00-00-00-00-00-00][n/a] [n/a]
172.30.5.197 3 ms sq04.home.test 80,443,8080 WORKGROUP\SQ04@SQ04 [00-00-00-00-00-00][n/a] [n/a]
172.30.5.202 6 ms pc02.home.test [n/a] [n/a] [n/a] [n/a]
172.30.5.1 is an the router (edgerouter x)
172.30.5.8 is a HP printer
172.30.5.27 is a TP-link router as an access point
172.30.5.28 is a openwrt router as an access point
172.30.5.202 is a Windows 8 PC
172.30.5.253 and .254 are the Ubuntu servers (missing)
no reponse on ping
C:\Windows\system32>tracert 172.30.5.254
Tracing route to 2ns4.home.test [172.30.5.254]
over a maximum of 30 hops:
1 4 ms 4 ms 4 ms 172.30.13.1
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * ^C
C:\Windows\system32>tracert 172.30.5.27
Tracing route to tp-share [172.30.5.27]
over a maximum of 30 hops:
1 4 ms 4 ms 4 ms 172.30.13.1
2 7 ms 7 ms 8 ms tp-share [172.30.5.27]
Trace complete.
C:\Windows\system32>
tracing from 172.30.13.41
C:\Windows\system32>tracert 172.30.5.254
Tracing route to 2ns4.home.test [172.30.5.254]
over a maximum of 30 hops:
1 3 ms 3 ms 3 ms 172.30.13.1
2 * * * Request timed out.
3 * * * Request timed out.
4 ^C
C:\Windows\system32>tracert 172.30.5.253
Tracing route to 2ns3.home.test [172.30.5.253]
over a maximum of 30 hops:
1 4 ms 4 ms 4 ms 172.30.13.1
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * ^C
C:\Windows\system32>
C:\Windows\system32>tracert 172.30.5.27
Tracing route to tp-share [172.30.5.27]
over a maximum of 30 hops:
1 4 ms 4 ms 4 ms 172.30.13.1
2 8 ms 7 ms 7 ms tp-share [172.30.5.27]
Trace complete.
C:\Windows\system32>
the problem is when the client is on a different subnet than the server
clients on the same subnet work