The simple way
At your level of knowledge, it might be best to ignore the second NIC (ie disconnect it) and have 2 IP addresses bound to the first NIC. The disadvantages are lack of redundancy and you are limited to the speed of 1 NIC.
To do this (for eth0), modify your /etc/network/interfaces file to read:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address A.A.A.A
netmask 255.255.252.0
gateway X.X.X.X
auto eth0:1
iface eth0:1 inet static
address B.B.B.B
netmask 255.255.252.0
Note that you will need to put in the correct gateway address for X.X.X.X. You will also need to make sure that the IP addresses (A.A.A.A and B.B.B.B) are not in the DHCP range.
The hard way
The idea here is to make the 2 interfaces act as 1 double speed interface (with the ability to continue work if an interface is unplugged), and then bring up the IP addresses similar to above.
The first difficulty to overcome is to work out what mode to use. There is no one-size fits all solution here, its the matter of choosing the most appropriate one for you and your hardware. Have a look here for a description of different modes. If in doubt, use mode 0 - this does not require fancy hardware, but you can only get the full effect of channel bonding for outbound traffic, but you still get redundancy. If you have traffic for lots of different addresses on the LAN, mode 2 is not a bad choice either.
You need to create a file like /etc/modprobe.d/bonding.conf to tell the system about how you want to do the bonding
alias bond0 bonding
options bond0 mode=0 miimon=100
(The above assumes you are using mode 0).
The easiest way to make this change come into effect is to reboot your computer.
You will now have a new interface available on your system "bond0". Using /etc/networks/interfaces you now enslave the 2 ethernet interfaces and then bring up the virtual interfaces as per example 1 above.
So the file will look like
# The loopback network interface
auto lo
iface lo inet loopback
# Enslave the ethernet drivers
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
auto eth1
iface eth1 inet manual
bond-master bond0
bond-primary eth1
# The primary network interface
auto bond0
iface bond0 inet static
address A.A.A.A
netmask 255.255.252.0
gateway X.X.X.X
auto bond0:1
iface bond0:1 inet static
address B.B.B.B
netmask 255.255.252.0
You have not statically assigned IP addresses, you have dynamically assigned them. Your problem is you have 2 interfaces on the same subnet/ A better way would be to bond the 2 interfaces into a single interface and then bring up a secondary interface on it if you need 2 IP's. – davidgo – 2016-03-23T02:50:44.783
How can i create another subnet ? How can i create 2 interfaces ? I do not understand it at all. – Venelin Vasilev – 2016-03-24T12:29:31.907