-1

How do I set the below values in linux?

I'm able to set destination and gateway, but I can't find anything in the docs RE passing a flag for genmask, flags, metric, ref, use or Iface.

Can anyone provide the value to pass? I've been able to construct the below

sudo route add -net 0.0.0.0 gw 192.168.96.0 tun0

But I need the full command to add the below;

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.96.0    0.0.0.0         UG    0      0        0 eth0

Thanks

CPdev
  • 101
  • 2

1 Answers1

1

For example:

route add -net 10.0.0.0/24 gw 10.16.101.1 metric 100 dev ens192

Usage:

 inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [mss Mss] [window W] [irtt I][mod] [dyn] [reinstate] [[dev] If]

About Flags:

If the ‘metric’ is non zero then ‘G’ flag is set else not.

Also, you can use ip r command.