I have a physical server that has two network cards. One of them is on the motherboard (card A) and the other is a new one that I added by myself (card B). this command:
lshw -class network
show that card A is active by default, no problem there. But card B is disabled, so I use:
sudo ifconfig enp3s0 up
to enabling card B. (enp3s0 is Card B logical name).
After this, I just want to set a static IP for card b. and for this purpose I used these commands:
ifconfig enp3s0 "My Ip" netmask 255.255.0 up route add default gw "My Ip" echo "nameserver 188.8.131.52"> /etc/resolve.conf
then I ping google, and everything is fine. But, after a reboot Card B loose all the setting and become disabled again.
So I did some search and I did find out that I need to do some static Ip setting. I use
sudo nano /etc/network/interfaces
to add static IP. and add this to interface file:
auto enp3s0 iface enp3s0 inet loopback iface enp3s0 iface enp3s0 inet static address "my ip" netmask 255.255.255.0 gw "my ip" dns-nameservers 184.108.40.206 220.127.116.11
After reboot, this setting is there, but Card B is disabled again.
for sums up, my question is, how to enable second network card permanently and how to set static Ip for it?
P.S: I have some network setting so I can't reset the network.