From 7c4329462e411c110b8dded92cc4b0d935e1e95d Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Wed, 23 Oct 2013 01:12:48 +0200 Subject: Add a connection type for dummy interfaces --- docs/netctl.profile.5.txt | 8 ++++++++ src/lib/connections/README | 3 +++ src/lib/connections/dummy | 26 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/lib/connections/dummy diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt index 0eac7c3..1f39361 100644 --- a/docs/netctl.profile.5.txt +++ b/docs/netctl.profile.5.txt @@ -42,6 +42,8 @@ AVAILABLE CONNECTION TYPES +bridge+:: Network bridging. This connection type requires *brctl* to be available. ++dummy+:: + For dummy interfaces. +pppoe+:: For PPPoE connections. +mobile_ppp+:: @@ -298,6 +300,12 @@ connections of the `bridge' type: be useful when DHCP is used on the bridge. +OPTIONS FOR `dummy' CONNECTIONS +------------------------------- +The name of the dummy interface is sepcified in 'Interface'. Only the +*ip options* are understood for connections of the `dummy' type. + + OPTIONS FOR `pppoe' CONNECTIONS ------------------------------- The interface to dial peer-to-peer over ethernet is specified in diff --git a/src/lib/connections/README b/src/lib/connections/README index db840d6..6d8db9b 100644 --- a/src/lib/connections/README +++ b/src/lib/connections/README @@ -26,3 +26,6 @@ available. The readily sourced files are: Here, is the profile file specifying the desired network configuration. + +A simple example of a connection file is that of the dummy connection +type. diff --git a/src/lib/connections/dummy b/src/lib/connections/dummy new file mode 100644 index 0000000..879fc92 --- /dev/null +++ b/src/lib/connections/dummy @@ -0,0 +1,26 @@ +# Contributed by: João Valverde + +. "$SUBR_DIR/ip" + +declare -ag BindsToInterfaces + +dummy_up() { + if is_interface "$Interface"; then + report_error "Interface '$Interface' already exists" + return 1 + fi + + ip link add "$Interface" type dummy + + bring_interface_up "$Interface" + ip_set +} + +dummy_down() { + ip_unset + bring_interface_down "$Interface" + ip link del "$Interface" +} + + +# vim: ft=sh ts=4 et sw=4: -- cgit v1.2.3-24-g4f1b