If you must share two machines, you can try to install another network card for machine A (because the host is directly connected to the cat) to form a dual network card machine. One network card is used to connect the cat, and the other network card is connected to the machine B. Note that the network cable connected between the machine A and the machine B should be a cross-connected network cable, and then the machine A can set the IP and gateway, and the machine DNS B can call the DNS address of the machine A, so that the two machines can be connected.
A machine is turned on, and B machine can access the Internet. A machine and B machine can't access the Internet either.