Would help to know which machines and OS you have.
Recent Macs don't even need a hub - just Ethernet port to Ethernet port.
Turn on Appletalk, Turn on File Sharing, share a folder, or log in with the owner's name and password. YMMV depending on OS version.
If you are talking only about file sharing between two modern Macs you only strictly need one ethernet cable connected between the Macs.
If you are running OS X then the OS will negotiate the addressing for you automatically. All you need to do is turn on Personal File sharing on the Mac that you want to copy the files from, then place the files in your "Public" folder in your home directory. Alternatively you could turn on "Windows Sharing" and set that up to share folders or whole drives on your machines. On the other mac you go to the finder menu and select "Go->Network" and navigate to the other Mac.
I would expect this to also work if you have the machines connected to a Hub. That is an ethernet cable from one Mac into the Hub with a second ethernet cable from the Hub to the second Mac.
If you want this for more than just file access between the two machines, for example so that you can share an internet connection between the machines then you probably need to set up a switching router rather than a hub. But this depends on exactly what you are trying to do.