Duplicate wifi connection but with different gateway

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 7
    Windows 7 SP1 Ultimate 64 bits
    Thread Starter
       #11

    I didn't tried basic shortcuts because I saw that the TCP-IP modifications alter ALL the network interfaces. This is precisely why I'm asking the question here...

    Creating two hardware profiles is not a solution because I don't want to reboot each time I start & stop the correct gateway under windows...
      My Computer


  2. aem
    Posts : 2,698
    Windows 7 Ultimate 64Bit
       #12

    trucmuche2005 said:
    I didn't tried basic shortcuts because I saw that the TCP-IP modifications alter ALL the network interfaces. This is precisely why I'm asking the question here...
    Then you have the answer you are looking for. No can do what you wanted done.
      My Computer


  3. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #13

    As aem said, what you want really can't be done.

    I have to wonder why you're trying to do this - allowing your Linux system to have an Internet connection but preventing Windows from having one. Doesn't make much sense to me, I sense some paranoia here. Why is it so important for you to keep Windows away from the 'net?
      My Computer


  4. Posts : 120
    Win 7
       #14

    OK, simple.

    Create a script that uses the "route" command. (I usually write shell scripts using Cygwin, a Unix-like environment that runs on Windows. Much more powerful than DOS-type scripting.)

    Start by running "route print". That produces a listing of your existing route table ... including the Internet-accessible gateway information. Save that and turn it into a script (as a series of "route" commands). Whenever you run that script, it will produce the desired routing, with internet access.

    Make a copy of the script, and change the copy: Leave the "local" network routes alone, but change any address range that points to the proper internet gateway so that it instead points to a bogus address in your subnet. Whenever you run that script, internet access will not be available.

    Create a shortcut for the first script, and call it "Internet", or similar.
    Create a shortcut for the second script, and call it "No Internet".
      My Computer


  5. Posts : 7
    Windows 7 SP1 Ultimate 64 bits
    Thread Starter
       #15

    Thank you all for your interest in my question !

    @ Corazon : You're wondering why I want to do this. Why people can't usually admit that, sometimes, the man who asks a question has a good reason to ask it ? I explained my technical reason but I don't want to explain my entire life to discuss whether or not something can technically be done in window. Should I ? You talk about "paranoia". This is not the case BUT even if it was, why does it matter for you ? I WANT to do this, what kind of authority you got about me to discuss the reason ? You think that there is no reason to keep windows off internet ? I got one and I don't have to share it with you... I'm looking for a solution, not for a psychanalist, I don't need that...

    @ lhorwinkle : THANK YOU !! I should have think about this solution myself !! Thank you very very much ! So easy...

    I'll test it and if ok, mark this question as solved ;-)

    Thank you all !
      My Computer


  6. Posts : 120
    Win 7
       #16

    Run "route print" ...

    MY FIRST COMPUTER, WIN XP: Its IP is 192.168.1.65
    Code:
    ignore--> INTERFACE LIST
    ignore--> 0x1 ........................... MS TCP Loopback interface
    ignore--> 0x2 ...00 1b 38 80 af 54 ...... Intel 82566MM Gigabit Network Connection
    ignore--> 0x3 ...00 ff d0 c2 8d 88 ...... Juniper Network Connect Virtual Adapter
    
                       ACTIVE ROUTES:
                       NETWORK DESTINATION       NETMASK         GATEWAY     INTERFACE    METRIC
    CHANGE THIS       -->         0.0.0.0          0.0.0.0   192.168.1.254  192.168.1.65     20
    loopback          -->       127.0.0.0        255.0.0.0       127.0.0.1     127.0.0.1      1
    local LAN address -->     192.168.1.0    255.255.255.0    192.168.1.65  192.168.1.65     20
    local LAN address -->    192.168.1.65  255.255.255.255       127.0.0.1     127.0.0.1     20
    local LAN address -->   192.168.1.255  255.255.255.255    192.168.1.65  192.168.1.65     20
    special           -->       224.0.0.0        240.0.0.0    192.168.1.65  192.168.1.65     20
    special           --> 255.255.255.255  255.255.255.255    192.168.1.65  192.168.1.65      1
    my router         --> DEFAULT GATEWAY:   192.168.1.254
    MY SECOND COMPUTER, WIN 7: Its IP is 192.168.1.65
    This computer is 192.168.1.64
    Code:
    ignore--> INTERFACE LIST
    ignore-->  11...70 71 bc b8 9d 7f ......Intel 82567V-2 Gigabit Network Connection
    ignore-->   1...........................Software Loopback Interface 1
    ignore-->  12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
    ignore-->  10...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
    
                       ACTIVE ROUTES:
                       NETWORK DESTINATION       NETMASK         GATEWAY     INTERFACE    METRIC
    CHANGE THIS       -->         0.0.0.0          0.0.0.0   192.168.1.254  192.168.1.64     20
    loopback          -->       127.0.0.0        255.0.0.0       On-link       127.0.0.1    306
    loopback          -->       127.0.0.1  255.255.255.255       On-link       127.0.0.1    306
    loopback          --> 127.255.255.255  255.255.255.255       On-link       127.0.0.1    306
    local LAN address -->     192.168.1.0    255.255.255.0       On-link    192.168.1.64    276
    local LAN address -->    192.168.1.64  255.255.255.255       On-link    192.168.1.64    276
    local LAN address -->   192.168.1.255  255.255.255.255       On-link    192.168.1.64    276
    special           -->       224.0.0.0        240.0.0.0       On-link       127.0.0.1    306
    special           -->       224.0.0.0        240.0.0.0       On-link    192.168.1.64    276
    special           --> 255.255.255.255  255.255.255.255       On-link       127.0.0.1    306
    special           --> 255.255.255.255  255.255.255.255       On-link    192.168.1.64    276
    For both computers, look at the line I marked "CHANGE THIS".
    As it stands, this maps my internet through my router (GATEWAY 192.168.1.254).
    If I change the GATEWAY to, say, my loopback address 127.0.0.1, then internet traffic would be blocked.

    For the script that allows internet access:
    route delete 0.0.0.0 mask 0.0.0.0
    route add 0.0.0.0 mask 0.0.0.0 ROUTER metric 20

    where ROUTER is the IP of your local internet router

    For the script that denies internet access:
    route delete 0.0.0.0 mask 0.0.0.0
    route add 0.0.0.0 mask 0.0.0.0 127.0.0.1 metric 20


    Note: I do this sort of thing on that first computer (running Win XP). I've not tried it on the second computer (running Win 7).
    Last edited by lhorwinkle; 16 Oct 2011 at 15:25.
      My Computer


  7. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #17

    trucmuche2005 said:
    @ Corazon : You're wondering why I want to do this. Why people can't usually admit that, sometimes, the man who asks a question has a good reason to ask it ? I explained my technical reason but I don't want to explain my entire life to discuss whether or not something can technically be done in window. Should I ? You talk about "paranoia". This is not the case BUT even if it was, why does it matter for you ? I WANT to do this, what kind of authority you got about me to discuss the reason ? You think that there is no reason to keep windows off internet ? I got one and I don't have to share it with you... I'm looking for a solution, not for a psychanalist, I don't need that...
    Sensitive much? I just wanted to understand your desire for keeping Windows out of the Internet, that's all. Trust me, I'm not interested in psychoanalyzing you :P
      My Computer


  8. aem
    Posts : 2,698
    Windows 7 Ultimate 64Bit
       #18

    Well i tested it and it it didn't work. What is the exact code do not put in Change this etc.
      My Computer


  9. Posts : 120
    Win 7
       #19

    aem said:
    Well i tested it and it it didn't work. What is the exact code do not put in Change this etc.
    In my earlier post, look at the results from the "route print" command. There's only one route that needs to be changed for Internet vs. No Internet.

    So, to enable internet, run these two commands (from a command prompt) ...
    route delete 0.0.0.0 mask 0.0.0.0
    route add 0.0.0.0 mask 0.0.0.0 ROUTER metric 20

    ... be sure to replace ROUTER with the IP of your local internet router (DSL modem or cable modem). In the example, mine is 192.168.1.254, but yours might be different.

    To disable internet ...
    route delete 0.0.0.0 mask 0.0.0.0
    route add 0.0.0.0 mask 0.0.0.0 127.0.0.1 metric 20
      My Computer


  10. aem
    Posts : 2,698
    Windows 7 Ultimate 64Bit
       #20

    It disconnects the internet but when you Disconnect and Reconnect your wifi, it back to normal.
      My Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:02.
Find Us