File: vrf

package info (click to toggle)
ifupdown-ng 0.12.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 964 kB
  • sloc: ansic: 3,572; sh: 980; makefile: 233
file content (30 lines) | stat: -rwxr-xr-x 552 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
handle_init() {
	${MOCK} /sbin/ip link $1 $IFACE type vrf table $IF_VRF_TABLE
	${MOCK} /sbin/ip rule $1 iif $IFACE table $IF_VRF_TABLE
	${MOCK} /sbin/ip rule $1 oif $IFACE table $IF_VRF_TABLE
}

handle_member() {
	${MOCK} /sbin/ip link set $IFACE master $IF_VRF_MEMBER
}

[ -n "$VERBOSE" ] && set -x

case "$PHASE" in
create)
	[ -n "$IF_VRF_TABLE" ] && handle_init "add"
	;;
pre-up)
	[ -n "$IF_VRF_MEMBER" ] && handle_member
	;;
destroy)
	[ -n "$IF_VRF_TABLE" ] && handle_init "del"
	;;
depend)
	echo "$IF_VRF_MEMBER"
	;;
*)
	exit 0
	;;
esac