Adding A New NIC In Ubuntu
Written by:
Will Kruss
on
31 May 2016 02:50 PM
|
|
If you are adding a second NIC in Ubuntu, It requires some reconfiguration of network settings within Ubuntu. If you are adding a second NIC in Ubuntu, it's most likely that it will not automatically pick up the settings properly when you boot up the VPS. It requires some reconfiguration of network settings within Ubuntu. Firstly, you'll probably need console access as your VPS may no longer be accessible, see: https://www.vpsblocks.com.au/support/Knowledgebase/Article/View/28/0/how-can-i-get-console-access-to-my-vps Once you have access via the console, do the following: ifconfig -a This will output the current NICs. Most likely you have one called eth0 and one called renameX. Keep a note of the two MAC addresses (HWaddr). If you have no network access to your VPS then the HWaddr of eth0 is the NIC you just added. nano /etc/udev/rules.d/70-persistent-net.rules Edit the above file using nano. If there is not a line for each NIC you need to add one: SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="05:15:5d:02:12:0d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" The ATTR address in the line should match the NIC you just added. Give it a name such as eth1. Before you save the file make you that you have one line for each NIC, and that the ATTR address in each line matches the ATTR addresses you copied down earlier. Save the file and exit. nano /etc/network/interfaces Here you need to specify each NIC by name and set the IPs appropriately, for example: auto lo auto eth0 auto eth1 Once you have done that, save the file and then type: /etc/init.d/networking restart This should bring up the interfaces immediately, in our example running an ifconfig should list both eth0 and eth1. root@vps:~# ifconfig eth1 Link encap:Ethernet HWaddr 05:15:5d:02:12:0d lo Link encap:Local Loopback If it doesn't, you can try restarting the server. Alternatively, you may have mixed up the mac addresses and assigned the incorrect IPs to each adapter. If this is the case you can simply edit the /etc/network/interfaces file again and swap the networking information for each interface, then restart networking again. | |
|