-ip route add dev ${dev} ${net_addr}/${prefix} via ${gateway}
\ No newline at end of file
+%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
\ No newline at end of file