An Ethernet is simple to configure. Since it uses physical cables, there are no special requirements such as authentication. However, a wireless LAN requires authentication—for example, a WEP key as well as the ESSID of the wireless network to connect. Let's see how to connect to a wireless as well as a wired network by writing a shell script.
To connect to a wired network, we need to assign an IP address and subnet mask by using the
ifconfig utility. But for a wireless network connection, it will require additional utilities, such as
, to configure more parameters.
In order to connect to a network from a wired interface, execute the following script: ...