Setup static IP address on ethernet


I have two due. Each one is connected via ethernet wire to a switch (It's not a router or modem and so no internet but just a switch) ( Then from Switch there is one ethernet wire to laptop. What I want is one due send data to other due via ethernet and then other due is connected to laptop via usb serial and should be able to display that data received on serial monitor of IDE. Please let me know what should I do ? Would appreciate if you could provide with a toy code ?

Thanks in advance.