Last active
May 13, 2020 19:24
-
-
Save tiagocoutinho/9997cc984d3cb51b0896a71a5b34dafb to your computer and use it in GitHub Desktop.
virtual local network
This file contains hidden or 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
# Execute with sudo | |
# Recipe at: https://unix.stackexchange.com/questions/152331/how-can-i-create-a-virtual-ethernet-interface-on-a-machine-without-a-physical-ad | |
NAME=bl04-eth | |
ALIAS=$NAME:0 | |
MAC=00:22:22:ff:ff:ff | |
IP=192.168.100.199 | |
# Create interface | |
ip link add $NAME type dummy | |
# Change MAC | |
ifconfig eth10 hw ether $MAC | |
# Create an alias | |
sudo ip addr add $IP/24 brd + dev $NAME label $ALIAS | |
ip link show $NAME | |
# optionaly add in your /etc/hosts: | |
# $IP bl04cryocon bl04mythen | |
This file contains hidden or 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
# Execute with sudo | |
NAME=bl04-eth | |
ALIAS=$NAME:0 | |
MAC=00:22:22:ff:ff:ff | |
IP=192.168.100.199 | |
sudo ip addr del $IP/24 brd + dev $NAME label $ALIAS | |
sudo ip link delete $NAME type dummy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment