aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeiger <geigereitan@gmail.com>2017-03-05 14:26:15 +0200
committerJan Macku <jamacku@redhat.com>2021-06-24 12:11:04 +0200
commit2e8de416fe609b04f2af3995890d9be8276c5e7b (patch)
tree9ef6ec79a446569ef60d256a7004d7cda7e5fb12
parenta8212c1b232a902938d0e5ea6a82bd6ae52e861c (diff)
downloadinitscripts-2e8de416fe609b04f2af3995890d9be8276c5e7b.tar
initscripts-2e8de416fe609b04f2af3995890d9be8276c5e7b.tar.gz
initscripts-2e8de416fe609b04f2af3995890d9be8276c5e7b.tar.bz2
initscripts-2e8de416fe609b04f2af3995890d9be8276c5e7b.tar.xz
initscripts-2e8de416fe609b04f2af3995890d9be8276c5e7b.zip
added veth support
-rwxr-xr-xnetwork-scripts/ifup-eth11
1 files changed, 11 insertions, 0 deletions
diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth
index a4c0d2b4..04861e56 100755
--- a/network-scripts/ifup-eth
+++ b/network-scripts/ifup-eth
@@ -45,6 +45,17 @@ if [ -n "${HWADDR}" ]; then
fi
fi
+# Create veth device
+if [ "${TYPE}" = "Veth" ]; then
+ if [ -z "${PEER}" ]; then
+ net_log $"cannot create veth without peer"
+ exit 1
+ fi
+ if [ ! -d /sys/class/net/${DEVICE} ]; then
+ ip link add ${DEVICE} type veth peer name ${PEER} type veth
+ fi
+fi
+
# If the device is a bridge, create it
if [ "${TYPE}" = "Bridge" ]; then
bridge_opts=""