Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My computer has 3 Network Interface cards (NICS) and one more virtual Network Adapter that in reality is connected via USB to a Modem. It's a complex setup - the problem is I have multiple Internet connections (3) and want to restrict my computer to always use only one of them - and if that one connection is say switched off or disconnected, It should go internet-less and should not fallback to internet connections with higher metric values.

Deleting two unwanted entries has no effect, because they get recreated on restart.

My route table has 3 gateways for the internet { network destination 0.0.0.0 & mask 0.0.0.0 } I have given metric values as follows :

Lowest (10) to the one I want to use. Higher (20 & 30) to the rest of the two. This means I use the correct internet connection when I boot up with all modems lit up and running.

This also means if my preferred connection is say switched of, when my computer booted up, it did a fallback to the connection with 20 metric value, which I don't want - Any thoughts on how I can prevent this fallback? Deleting the other two entries has no effect, because they get recreated on restart.

share|improve this question
    
(1) What's your distro, and (2) Are you using DHCP? –  pepoluan Mar 30 '11 at 13:26
    
Im using Windows 7 –  Zasz Mar 30 '11 at 13:30
    
uh... if you're using Windows, why did you tag your question with iptables? iptables exist only in Linux. –  pepoluan Mar 30 '11 at 13:32
    
Oops - apologies for the wrong tag, but I was sure iptables term was OS agnostic! –  Zasz Mar 30 '11 at 13:47
    
I've fixed the tag for you. iptables is the name of a program in Linux used to manage Linux's built-in firewall (netfilter). you may have confused iptables with "routing tables" –  pepoluan Mar 30 '11 at 13:50

2 Answers 2

up vote 1 down vote accepted

Remove the gateway specification from the interface specifications for the interfaces you don't want to have default routes defined on. This is usually defined in the file where you define the IP address and netmask for the interface.

share|improve this answer
    
How do I go about removing a gateway specification from the interface in Windows 7? –  Zasz Mar 30 '11 at 13:45
    
Thanks for the reply will google along these lines - but I still have my problem –  Zasz Mar 30 '11 at 13:46
    
@Zasz: Default gateway is set in the network interface configuration for the interface. Open Control Panel -> Network and Interfaces -> Network Connections. Select the interface, and open the properties window. Default gateway is set in the Internet Protocol Version 4 properties –  BillThor Mar 30 '11 at 13:51
    
Excellent, that resolved my issue - I removed the gateway from the adapter, and persists on restart. I'm marking your answer as the right one :) –  Zasz Mar 30 '11 at 13:56

Since you're using Windows:

  • Remove all Default Gateway's from the interfaces you don't want to use

How to remove Default Gateway's from interfaces

  • Start Menu > Control Panel > View Network Status and Tasks > Change Adapter Settings.

  • Right-click on the interface > Properties

  • Click "Internet Protocol Version 4" > Click Properties

  • Click "Advanced..."

  • Click on the entry(-ies) under "Default gateways" and click "Remove" for each

Note: This does not work on DHCP-assigned interfaces

share|improve this answer
    
Is there a DOS command that can do what you say, or is there UI for this? Google doesn't help much on "Removing gateways from Network Adapter" - In fact I'm hitting this page as the main result! (KUDOS to StackExchange SEO) –  Zasz Mar 30 '11 at 13:51
    
@Zasz I've edited my answer. –  pepoluan Mar 30 '11 at 14:03
    
Thanks. BillThor beat you to it, but your answer is much clearer to future viewers. –  Zasz Mar 30 '11 at 14:31
    
Thanks, that resolved it - I removed the default gateways for the unwanted NICs - Your answer will be more helpful to future viewers. –  Zasz Mar 30 '11 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.