Created
February 11, 2020 21:32
-
-
Save ovidiu-ionescu/337bd7a1a288041354b03e004aebb397 to your computer and use it in GitHub Desktop.
Create a dummy network interface in Linux
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
#!/bin/bash | |
# Creates a dummy network interface, useful for running a local server | |
SUDO='' | |
if (( $EUID != 0 )); then | |
SUDO='sudo' | |
fi | |
NAME=organizator | |
$SUDO ip link add $NAME type dummy | |
$SUDO ip addr add 192.168.0.42/16 dev $NAME | |
$SUDO ip link set $NAME up | |
# remove using | |
# ip link del $NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment