It should not be that difficult... were it not for your network manager, which tries to get an IP address from a non-existent DHCP server, and then gives precedence to the wired connection over the wifi, thus erasing your default gateway, and shutting you off from the Internet. So: stop your network manager
systemctl stop network-manager
service network-manager stop
(I do not know whether Mageia uses systemd or not, but at least one of the commands above will work), then give an IP address to your cable interface
ip addr add 10.0.122.1/24 dev eth0
(if the interface is not called eth0 please adjust accordingly). No need to add other routes. Do exactly the same on the other pc, except you will have to use
ip addr add 10.0.122.2/24 dev eth0
, i.e. a different IP address. Now you should be able to ping one machine from the other.
If you need to transfer data via wifi simultaneously, you will have to do that manually because network-manager will plunge you into the same pit you just dug yourself out of. So:
ip route del default
wpa_passphrase MyNetworkName MySecretPassword > mydata.txt
wpa-Supplicant -B -i wlan0 -Dnl80211 -c mydata.txt
dhclient -v wlan0
And you should be good to go. If not, please just add the follwoing routing rule:
ip route add default via IPAddressOfYourRouter dev wlan0
and now you can do whatever you like. If you also need to have data go to the other pc, then you will have to give these commands on the pc which is connected via wifi:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
while on the pc which is only connected via cable,
ip route add default via 10.0.122.1 dev eth0
and you are done.
When done, unplug the cable and restart the network-manager.