summaryrefslogtreecommitdiffstats
path: root/src/lib/connections
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/connections')
-rw-r--r--src/lib/connections/bond5
-rw-r--r--src/lib/connections/bridge5
-rw-r--r--src/lib/connections/dummy6
-rw-r--r--src/lib/connections/vlan4
4 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/connections/bond b/src/lib/connections/bond
index c22fc82..9cc8b96 100644
--- a/src/lib/connections/bond
+++ b/src/lib/connections/bond
@@ -10,7 +10,7 @@ bond_up() {
report_error "Interface '$Interface' already exists"
return 1
else
- ip link add name "$Interface" type bond
+ interface_add bond "$Interface"
fi
bring_interface_up "$Interface"
@@ -28,8 +28,7 @@ bond_down() {
done
ip_unset
- bring_interface_down "$Interface"
- ip link delete "$Interface"
+ interface_delete "$Interface"
}
diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge
index 94a4802..b358e01 100644
--- a/src/lib/connections/bridge
+++ b/src/lib/connections/bridge
@@ -11,7 +11,7 @@ bridge_up() {
return 1
fi
else
- ip link add name "$Interface" type bridge
+ interface_add bridge "$Interface"
fi
for member in "${BindsToInterfaces[@]}"; do
@@ -34,8 +34,7 @@ bridge_down() {
done
ip_unset
- bring_interface_down "$Interface"
- ip link delete "$Interface" type bridge
+ interface_delete "$Interface"
}
diff --git a/src/lib/connections/dummy b/src/lib/connections/dummy
index 879fc92..5a12d1e 100644
--- a/src/lib/connections/dummy
+++ b/src/lib/connections/dummy
@@ -10,16 +10,14 @@ dummy_up() {
return 1
fi
- ip link add "$Interface" type dummy
-
+ interface_add dummy "$Interface"
bring_interface_up "$Interface"
ip_set
}
dummy_down() {
ip_unset
- bring_interface_down "$Interface"
- ip link del "$Interface"
+ interface_delete "$Interface"
}
diff --git a/src/lib/connections/vlan b/src/lib/connections/vlan
index e9ab08b..b34a67e 100644
--- a/src/lib/connections/vlan
+++ b/src/lib/connections/vlan
@@ -12,7 +12,7 @@ vlan_up() {
return 1
else
bring_interface_up "$BindsToInterfaces"
- ip link add link "$BindsToInterfaces" name "$Interface" type vlan id "$VLANID"
+ interface_add vlan "$Interface" "$BindsToInterfaces" id "$VLANID"
fi
ethernet_up
@@ -20,7 +20,7 @@ vlan_up() {
vlan_down() {
ethernet_down
- ip link delete "$Interface"
+ interface_delete "$Interface"
}