Last active
December 31, 2015 09:29
-
-
Save alex4u2nv/7967308 to your computer and use it in GitHub Desktop.
Update the network interface for a cloned linux virtual machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifconfig eth1 up && eth1=`ifconfig | grep eth1 | sed 's/.*HWaddr //g'` && cat /etc/sysconfig/network-scripts/ifcfg-eth0 | sed "s/HWADDR.*/HWADDR=$eth1/" | sed "s/eth0/eth1/g" > /etc/sysconfig/network-scripts/ifcfg-eth1 && rm /etc/sysconfig/network-scripts/ifcfg-eth0 && service network restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment