Networking directly to a laptop or computer
It is possible to connect Raspberry Pi LAN port directly to a laptop or computer using a single network cable. This will create a local network link between the computers, allowing all the things you can do if connected to a normal network without the need for a hub or a router, including connection to the internet, if Internet Connection Sharing (ICS) is used, as follows:
ICS allows Raspberry Pi to connect to the internet through another computer. However, some additional configuration is required for the computers to communicate across the link, as Raspberry Pi does not automatically allocate its own IP address.
We will use the ICS to share a connection from another network link, such as a built-in Wi-Fi on a laptop. Alternatively, we can use a direct network link (refer to the Direct network link section under the There's more... section) if the internet is not required or if the computer has only a single network adapter.