I have two LAN cards in my system. I need to change between the LAN cards using command line. Also I want to know whether I can switch between the LAN cards automatically when one of them goes down.
How should I proceed?
I have two LAN cards in my system. I need to change between the LAN cards using command line. Also I want to know whether I can switch between the LAN cards automatically when one of them goes down.
How should I proceed?
When using network-manager
(which is standard on ubuntu) you can use nmcli
to disable devices. So nmcli dev disconnect iface eth0
disables eth0 and your system is forced to use another card. Sadly I haven't found out how to reenable it without the GUI.
I think you may misunderstand the NIC card setup. if you have to cards and you have connected them to the same network say 192.168.1.x than they will both have an Ip address and you are essentially using both. If they are on separate networks like a LAN and a WAN then the system SHOULD take of all the necessary routing for you. Packets for the internet will go over that nic, packets for the local will go over that nic assuming all other things are setup correctly.
I suppose you could have some very specific/unexpected configs that I dindt mention here.
This will bring a NIC named eth0 up (usable)
sudo ifconfig eth0 up
This will bring a NIC named wifi0 down (disabled)
sudo ifconfig wifi0 down
change between the lan cards using command line
. – heemayl Feb 02 '15 at 11:32