Ubuntu Zero to Hero Ubuntu Zero to Hero | Page 22

Network configuration Ubuntu is a very versatile distribution of the Linux operating system, as such you have a lot of flexibility over your network configuration. This is an area of the operating system that you can't just pick up and understand, even with a guide like this, you'll probably want to test your changes on a development / test environment before hitting a live site with your new skills. I'll keep this section light as most of the network configuration is handled by cloud hosts through a visual interface. Ethernet You can have several Ethernet interfaces configured on your server, these are identified by the naming convention ethX (x is replaced with a numeric value to help identify your connection (starting with eth0)). Command Comments If config -a | grep eth Helps you to identify all available ethernet interfaces. This particular command will list the MAC address of the hardware and provide the ethernet interface id (ethx). Sudo lshw -class network This provides you with a more in depth view of the above. It'll let you know more details about the product (including the vendor) and it'll also detail size, capacity and conguration. Sudo apt-get install ethtool Ethtool is a management tool that will let you change ethernet card settings (e.g. port speed). Using the command to the left, you'll be able to install it. Changes made using the ethtool are temporary and will be wiped on reboot. If you'd like to retain your changes, you can add the command you ran in ethtool (as a pre-up statement) to the ethernet interface configuration file, which can be found here: /etc/network/interfaces. An example pre-up statement (taken from the official Ubuntu documentation) is shown below. This statement will permanently configure port speed to 1,000 mb/s running on full duplex mode. pre-up /sbin/ethtool -s eth0 speed 1000 duplex full IP Addresses If you're using a cloud service such as AWS or Digital Ocean, then the likelihood is that they will cover this section for you. My instances are always created with public and private IP addresses already assigned and configured, so I'll assume that yours are too! www.netshock.co.uk