Error connecting 2 jetson with ethernet cable

I have two running machines That I want to communicate between with an ethernet cable.

machine A)

ethtool -i eth2
driver: nvethernet
version: 5.10.192-tegra
firmware-version: 
expansion-rom-version: 
bus-info: 6810000.ethernet
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 3c:6d:66:02:c4:6f brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.101/24 brd 192.168.2.255 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
    inet 192.168.2.101/32 scope global eth2
       valid_lft forever preferred_lft forever

And machine B)

ethtool -i eth0
driver: nvethernet
version: 5.15.136-rt-tegra
firmware-version: 
expansion-rom-version: 
bus-info: 6800000.ethernet
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1466 qdisc mq state UP group default qlen 1000
    link/ether 48:b0:2d:a5:1a:d2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.102/24 brd 192.168.2.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.102/32 scope global eth0
       valid_lft forever preferred_lft forever

They are both connected to a passive switch.
I can’t ping from A to B and the other way.
also running Nmap on each of them tells me they do not know each other.
what am I missing here?

machine A)

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

machine B)

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

I tried using a crossover cable but it didn’t work so I thought a switch would do the trick

Try to connect port to port and assign static IP to it.

I have tried this method. but it still doesn’t seem to work