Skip to content

Instantly share code, notes, and snippets.

@cathay4t
Last active March 6, 2020 13:14
Show Gist options
  • Save cathay4t/626136dfe4e349036eaf1f1992358b15 to your computer and use it in GitHub Desktop.
Save cathay4t/626136dfe4e349036eaf1f1992358b15 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
if [[ $1 ]]; then
sudo ip link del eth1
sudo ip link del eth2
sudo nmcli c delete eth1 eth2
exit
fi
sudo ip link add eth1 type veth peer name eth1.ep
sudo ip link add eth2 type veth peer name eth2.ep
sudo ip link set eth1 up
sudo ip link set eth1.ep up
sudo ip link set eth2 up
sudo ip link set eth2.ep up
sudo nmcli device set eth1 managed yes
sudo nmcli device set eth2 managed yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment