File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 232232 ( route : {
233233 destination = if ( route . dst == "default" ) then "0.0.0.0/0" else route . dst ;
234234 gateway = route . gateway ;
235+ onlink = builtins . elem "onlink" route . flags ;
235236 } )
236237 (
237238 builtins . filter (
251252 routes = builtins . map ( route : {
252253 Destination = route . destination ;
253254 Gateway = route . gateway ;
255+ GatewayOnLink = if ( route . onlink ) then "yes" else "no" ;
254256 } ) interface . value . route ;
255257 } ;
256258 } ) network-config
Original file line number Diff line number Diff line change 115115 ip address add $config dev $name
116116 done
117117
118+ ip link set $name up
119+
118120 for route in $routes; do
119121 protocol=$(echo "$route" | jq -r '.protocol')
120122 dev=$(echo "$route" | jq -r '.dev')
123125 continue
124126 fi
125127
126- config="$(echo $route | jq -r '.dst') via $(echo $route | jq -r '.gateway')"
128+ args=""
129+ flags=$(echo "$route" | jq -r '.flags')
130+ if [[ $flags == *"onlink"* ]]; then
131+ args="$args onlink"
132+ fi
133+
134+ config="$(echo $route | jq -r '.dst') via $(echo $route | jq -r '.gateway') $args"
127135 ip route add $config dev $name
128136 done
129137 done
You can’t perform that action at this time.
0 commit comments