Skip to content

Instantly share code, notes, and snippets.

@ovidiu-ionescu
Created February 11, 2020 21:32
Show Gist options
  • Save ovidiu-ionescu/337bd7a1a288041354b03e004aebb397 to your computer and use it in GitHub Desktop.
Save ovidiu-ionescu/337bd7a1a288041354b03e004aebb397 to your computer and use it in GitHub Desktop.
Create a dummy network interface in Linux
#!/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