List all IPv4 routes:

route print -4

 

Add route:

route add (destination subnet start IP) mask (subnet mask) (target gateway IP)
route add 172.16.47.0 mask 255.255.255.0 192.168.47.254

 

Delete route:

route delete (destination subnet start IP)
route delete 172.16.47.0

 

Make persistent (stay after reboot) - add flag -p:

route add -p 172.16.47.0 mask 255.255.255.0 192.168.47.254

 

CIDR notation subnet mask cheat sheet:

Hosts Netmask Amount of a Class C
/30 4 255.255.255.252 1/64
/29 8 255.255.255.248 1/32
/28 16 255.255.255.240 1/16
/27 32 255.255.255.224 1/8
/26 64 255.255.255.192 1/4
/25 128 255.255.255.128 1/2
/24 256 255.255.255.0 1
/23 512 255.255.254.0 2
/22 1024 255.255.252.0 4
/21 2048 255.255.248.0 8
/20 4096 255.255.240.0 16
/19 8192 255.255.224.0 32
/18 16384 255.255.192.0 64
/17 32768 255.255.128.0 128
/16 65536 255.255.0.0 256

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove that you are not a spam robot: * Time limit is exhausted. Please reload CAPTCHA.