title: How to permanently remove default routing rule for secondary network interface from window's IP routing table in C#
body: <p>I've a multi-homed windows machine (Windows Server 2016) and I want to make sure that outbound traffic never goes out through secondary network interface (progammatically via C#).</p>
  
  <p>I've 2 default entries for the network interfaces in my routing table:</p>
  
  <pre><code>Active Routes:
  Network Destination        Netmask          Gateway       Interface  Metric
            0.0.0.0          0.0.0.0      172.31.32.1    172.31.44.180     15
            0.0.0.0          0.0.0.0      172.31.96.1    172.31.96.230     15
  </code></pre>
  
  <p>I think permanently deleting the entry for secondary network interface will be sufficient for my use case. I want only this entry to exist afterwards:</p>
  
  <pre><code>Active Routes:
  Network Destination        Netmask          Gateway       Interface  Metric
            0.0.0.0          0.0.0.0      172.31.32.1    172.31.44.180     15
  </code></pre>
  
  <p>I found the C# API <code>DeleteIpForwardEntry</code> to delete the route, but I do not know how to make this deletion permanent, so that rebooting the machine doesn't undo my change. </p>
  
  <p>Any help will be appreciated.</p>