2 .
/usr
/lib
/network
/network
15 report_debug iproute_up ifup
$int
16 ip link
set up dev
"$int" up || \
17 fail
"Could not bring interface $int up"
20 [[ -n "$str" ]] ||
continue
21 report_debug iproute_up ip addr add dev
"$int" $str
22 ip addr add dev
"$int" $str || \
23 fail
"Adding address \"$str\" to $int failed"
27 [[ -n "$str" ]] ||
continue
28 report_debug iproute_up ip route add dev
"$int" $str
29 ip route add dev
"$int" $str || \
30 fail
"Adding route \"$str\" to $int failed"
37 ip link add link
"$int" name
"vlan$vlan" type vlan id
"$vlan"
42 ip link delete
"vlan$vlan"
48 [[ -e /sys
/class
/net
/"$INTERFACE" ]] || \
49 fail
"Interface $INTERFACE does not exist"
51 if [[ -n "$GATEWAY" ]]; then
52 ROUTE
="$ROUTE"$
'\n'"default via $GATEWAY"
54 int_setup
"$INTERFACE" "$ADDR" "$ROUTE"
57 [[ -n "$VLANS" ]] && for vlan
in $VLANS; do
58 report_debug iproute_up add vlan
"$INTERFACE" "$vlan"
59 vlan_create
"$INTERFACE" "$vlan"
61 route
="ROUTE_vlan$vlan"
62 int_setup
"vlan$vlan" "${!addr}" "${!route}"
66 if [[ -n "$HOSTNAME" ]]; then
67 report_debug iproute_up hostname
"$HOSTNAME"
68 hostname
"$HOSTNAME" || \
69 fail
"Cannot set hostname to $HOSTNAME"
72 # Generate a new resolv.conf
73 if [[ -n "$DNS" ]]; then
75 [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc
/resolv.conf
76 [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc
/resolv.conf
79 echo "nameserver $str" >>/etc
/resolv.conf
89 [[ -n "$VLANS" ]] && for vlan
in $VLANS; do
90 report_debug iproute_up drop vlan
"$vlan"
94 report_debug ethernet_down if_down
95 ip addr flush dev
"$INTERFACE"
96 quirk
"nodown" || ip link
set down dev
"$INTERFACE"
100 [[ -e /var
/run
/network
/profiles
/"$1" ]] && return 0