The main functions of a router are to route data packets, providing the best path for data to travel between different networks; to connect different networks, acting as the gateway for a local network to communicate with others like the internet; and to provide network security by filtering traffic and blocking unauthorized access to the local network.