The addresses 192.168.1.2
and 192.168.2.1
cannot talk to each other if you use the subnet 255.255.255.0
. Notice the third octet (number) of your IP addresses is different, in the answer you linked to they are they same.
You need to either change the subnet mask to 255.255.0.0
or change the IP address of the 192.168.2.1
machine to 192.168.1.1
so that the third octet matches (1). You will then be able to ping one computer from the other.
A crossover cable is not needed. Ethernet devices made in the last 10 or so years support auto MDI-X which eliminates the need for a crossover cable.
In order to establish a connection between the two machines using an Ethernet cable, both machines need a static IP of which are on the same IP Subnet.
1. Grab an ethernet cable, and attach it to the primary machine's ethernet port, take the other side of the cable and plug it into the secondary machine's ethernet port.
2. Identify your ethernet interfaces on each computer, it should be either eth0 or something like enp3s0. Take note of those interface names because we're going to need them later. You can do this by simply entering, sudo ifconfig
3. On the primary machine... run this command in your terminal/command line: sudo ifconfig eth0 10.0.0.1
(replace eth0 with the primary machine's ethernet interface.)
4. On the secondary machine... run this command in its terminal/command line: sudo ifconfig eth0 10.0.0.2
(replace eth0 with the second machine's ethernet interface.)
5. Now... The two computers should be able to communicate with each other. You can test this by entering the command, on your primary machine, ping 10.0.0.2 -c 2
... If you see "64 bytes from 10.0.0.2..." then the communication is working.
6. Connect to the secondary machine (IP Address: 10.0.0.2) using your FTP client... I'm assuming that you have already set up the FTP server on your secondary machine.
If these steps are unsuccessful please be sure to reply to me. The amazing part about this is the ability to configure a DHCP server to automatically assign an IP address to your secondary machine, but this is complicated.
Best Answer
Hmm, not sure why you'd be using/needing a crossover cable (From here: https://discussions.apple.com/thread/2178081?start=0&tstart=0 "... for years the Mac's ethernet ports have had the ability to reverse the polarity of the signals if a crossover is needed, automatically. No need for special cables when hooking up to a Mac.")
To get you started, both PC's need to be on the same LAN so they can see each other. Setup a static IP address on each PC. E.g: Mac-192.168.1.1 Ubuntu-192.168.1.2 Netmask for both 255.255.255.0
Try to ping each PC: Mac to Ubuntu: ping 192.169.1.2
Helpful links:
How to share files between Ubuntu and OSX?
https://superuser.com/questions/842924/directly-connect-macbook-to-linux-desktop-via-ethernet-for-fast-ssh