Yes, you will be able to do that. However, you must use the
right cable. It is called a crossover cable. It's a little bigger
than those telephone cables, called RJ-45 cables. To tell the
difference between a crossover cable and straight-through cable,
hold the heads side-by-side and compare. If the wiring of the
cables are the same, it means that the cables are straight-through.
If the wiring is different, then it is a crossover cable.
Straight-through cable

Crossover cable
