|
|
|
@ -3,20 +3,19 @@
|
|
|
|
|
<require-service <milestone network>>
|
|
|
|
|
<depends-on <milestone network> <service-state <daemon interface-monitor> ready>>
|
|
|
|
|
|
|
|
|
|
<configure-interface "lo" <static "127.0.0.1">>
|
|
|
|
|
<configure-interface "lo" <static "127.0.0.1/8">>
|
|
|
|
|
|
|
|
|
|
? <configure-interface ?ifname <static ?ipaddr>> [
|
|
|
|
|
! <run-oneshot ["ifconfig" $ifname $ipaddr "up"]>
|
|
|
|
|
?- ! <run-oneshot ["ifconfig" $ifname "down"] never>
|
|
|
|
|
! <run-oneshot ["ip" "address" "add" "dev" $ifname $ipaddr]>
|
|
|
|
|
?- ! <run-oneshot ["ip" "address" "del" "dev" $ifname $ipaddr] never>
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
? <configure-interface ?ifname <dhcp>> [
|
|
|
|
|
! <run-oneshot ["ifconfig" $ifname "up"]>
|
|
|
|
|
?- ! <run-oneshot ["ifconfig" $ifname "down"] never>
|
|
|
|
|
<require-service <daemon <udhcpc $ifname>>>
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
? <run-service <daemon <udhcpc ?ifname>>> [
|
|
|
|
|
; We use a custom script that gives mobile-data devices a sensible routing metric
|
|
|
|
|
<daemon <udhcpc $ifname> ["udhcpc" "-i" $ifname "-fR" "-s" "/usr/lib/synit/udhcpc.script"]>
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
@ -32,11 +31,19 @@
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
$machine ? <interface ?ifname _ normal _ _ carrier _> [
|
|
|
|
|
$machine ? <interface ?ifname _ _ _ _ _ _> [
|
|
|
|
|
$log ! <log "-" { saw-machine-interface: $ifname }>
|
|
|
|
|
$config [
|
|
|
|
|
! <run-oneshot ["ip" "link" "set" $ifname "up"]>
|
|
|
|
|
?- ! <run-oneshot ["ip" "link" "set" $ifname "down"] never>
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
$machine ? <interface ?ifname _ normal up up carrier _> [
|
|
|
|
|
$config <configure-interface $ifname <dhcp>>
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
$machine ? <route ?af default _ _ _ _> [
|
|
|
|
|
$config <default-route $af>
|
|
|
|
|
$machine ? <route ?addressFamily default _ _ _ _> [
|
|
|
|
|
$config <default-route $addressFamily>
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|