Differences
This shows you the differences between two versions of the page.
— | ubuntu_networking [2016/05/12 20:37] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Ubuntu Networking ====== | ||
+ | |||
+ | * [[Bonding]] | ||
+ | * [[Networking]] | ||
+ | * [[ifconfig]] | ||
+ | * [[ifenslave]] | ||
+ | * [[ifup]] | ||
+ | * [[ip]] | ||
+ | * [[route]] | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | The programs for configuring networking on Ubuntu are '' | ||
+ | |||
+ | Setting '' | ||
+ | |||
+ | Lines beginning with the word " | ||
+ | |||
+ | To make a device even recognized, all that needs to be done is set it to load automatically. This configuration will make the devices available, but not set anything for them: | ||
+ | |||
+ | < | ||
+ | auto eth0 | ||
+ | iface eth0 inet manual | ||
+ | |||
+ | auto eth1 | ||
+ | iface eth1 inet manual | ||
+ | </ | ||
+ | |||
+ | == Reload Network Configuration == | ||
+ | |||
+ | To use new settings in your '' | ||
+ | |||
+ | < | ||
+ | ifdown eth0; ifup eth0 | ||
+ | </ | ||
+ | |||
+ | === DHCP Client === | ||
+ | |||
+ | In the simplest case, getting an address from a DHCP server is easy. | ||
+ | |||
+ | Here's an example: | ||
+ | |||
+ | < | ||
+ | auth eth0 | ||
+ | iface eth0 auto dhcp | ||
+ | </ | ||
+ | |||
+ | Additional options for the '' | ||
+ | |||
+ | * **hostname** - hostname to be requested | ||
+ | * **metric** - metric for added routes (when using dhclient) | ||
+ | * **leasehours** - request lease time in hours (when using pump) | ||
+ | * **leasetime** - require least time in seconds (when using dhcpcd) | ||
+ | * **vendor** - vendor class identifier (dhcpcd) | ||
+ | * **client** - client identifier (when using dhcpcd or udhcpc) | ||
+ | * **hwaddress** - MAC address | ||
+ | |||
+ | === Manual IP Configuration === | ||
+ | |||
+ | Use a manual IP when you want the device to be available, but with no instructions attached to it. | ||
+ | |||
+ | * **hwaddress < | ||
+ | * **mtu < | ||
+ | |||
+ | === Static IP Address === | ||
+ | |||
+ | When setting a static IP address, use '' | ||
+ | |||
+ | * **address** - static IP address (required) | ||
+ | * **netmask** - dotted quad or CIPR format | ||
+ | * **broadcast** < | ||
+ | * **metric** - routing metric for default gateway (type integer) | ||
+ | * **gateway** - default gateway, dotted-quad format | ||
+ | * **pointtopoint** - address of other end-point, dotted-quad format | ||
+ | * **hwaddress** - MAC address | ||
+ | * **mtu** - MTU size | ||
+ | * **scope** - Address validity scope. Possible values: global, link, host | ||
+ | |||
+ | Here's an example of setting a static IP and manually setting DNS servers to Comcast: | ||
+ | |||
+ | < | ||
+ | |||
+ | auto lo | ||
+ | iface lo inet loopback | ||
+ | |||
+ | auto eth0 | ||
+ | iface eth0 inet static | ||
+ | address 192.168.1.2 | ||
+ | netmask 255.255.255.0 | ||
+ | gateway 192.168.1.1 | ||
+ | dns-nameservers 75.75.75.75 75.75.76.76 | ||
+ | </ | ||
+ | |||
+ | Google also offers some public DNS servers: | ||
+ | |||
+ | < | ||
+ | dns-nameservers 8.8.4.4 8.8.8.8 | ||
+ | </ | ||
+ | |||
+ | === Bonding === | ||
+ | |||
+ | Documentation for bonding in Ubuntu is found in the [[ifenslave]] documentation -- see ''/ | ||
+ | |||
+ | In this scenario, active-backup bonding is set up, meaning that if the first device specified goes down, the second becomes the active device. The MAC address of the first device will continue to be used. | ||
+ | |||
+ | Before anything, the bonding module for the kernel has to be loaded. Once it is, you will have an ethernet device '' | ||
+ | |||
+ | < | ||
+ | modprobe bonding | ||
+ | </ | ||
+ | |||
+ | Set up the system to load the bonding module on boot, in ''/ | ||
+ | |||
+ | < | ||
+ | bonding | ||
+ | </ | ||
+ | |||
+ | You will also need the '' | ||
+ | |||
+ | < | ||
+ | apt-get install ifenslave | ||
+ | </ | ||
+ | |||
+ | In ''/ | ||
+ | |||
+ | < | ||
+ | auto eth0 | ||
+ | iface eth0 inet manual | ||
+ | | ||
+ | |||
+ | auto eth1 | ||
+ | iface eth1 inet manual | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Once they are added, add the settings for the bonding configuration. In this scenario, the connection is checked very 100 ms. The mode is active-backup, | ||
+ | |||
+ | After that, you can configure the device as usual. For simplicity' | ||
+ | |||
+ | < | ||
+ | auto bond0 | ||
+ | iface bond0 inet dhcp | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Load the new networking configuration. To be safe, bring the eth* devices down first: | ||
+ | |||
+ | < | ||
+ | ifconfig eth0 down | ||
+ | ifconfig eth1 down | ||
+ | ifup bond0 | ||
+ | </ | ||
+ | |||