%if dev is not None: ip route add dev ${dev} ${net_addr}/${prefix} via ${gateway} %else: ip route add ${net_addr}/${prefix} via ${gateway} %endif