guessnet: controlling two interfaces - Debian

This is a discussion on guessnet: controlling two interfaces - Debian ; Hello, I'm using my notebook at home and in university, so I need different profiles for WLAN and LAN but I don't know how to put the configuration I want to have in a script or how to do it ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: guessnet: controlling two interfaces

  1. guessnet: controlling two interfaces

    Hello,

    I'm using my notebook at home and in university, so I need different
    profiles for WLAN and LAN but I don't know how to put the configuration
    I want to have in a script or how to do it in other ways.
    So the thing is: When I'm at home and the network-cable is plugged in,
    then it should use that connection and shouldn't start the
    WLAN-interface. If there isn't a network-cable, then it has to be
    sepparated between the differen WLAN-locations, which allready works.
    The problem is, that when both interfaces are started, the routing
    doesn't work. Form the /etc/interfaces below you can see, how I use
    guessnet for WLAN at the moment. Is there any possibility to change
    things, that it works as I described.

    Thanks
    Johannes

    PS: Sorry for the bad English!

    --------------------------------------

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # This is a list of hotpluggable network interfaces.
    # They will be activated automatically by the hotplug subsystem.
    mapping hotplug
    script grep
    map eth0

    auto eth1
    iface eth1 inet static
    address 192.168.178.102
    netmask 255.255.255.0
    network 192.168.178.0
    broadcast 192.168.178.255
    gateway 192.168.178.1
    dns-nameservers 192.168.178.1

    auto eth0
    mapping eth0
    script guessnet-ifupdown
    # Scan all logical interfaces
    map default: none
    map timeout: 3
    map verbose: true


    # The primary network interface
    iface home inet static
    address 192.168.178.202
    netmask 255.255.255.0
    network 192.168.178.0
    broadcast 192.168.178.255
    gateway 192.168.178.1
    # wireless-* options are implemented by the wireless-tools package
    wireless-mode managed
    wireless-essid spiderweb
    wireless-key1 #################
    wireless-keymode open
    # dns-* options are implemented by the resolvconf package, if installed
    #dns-nameservers 192.168.178.1

    test wireless essid spiderweb

    iface unibi inet dhcp
    wireless-mode managed
    wireless-essid unibi
    wireless-key off
    wireless-ap any
    up vpnc-connect
    down vpnc-disconnect

    test wireless essid unibi

    iface default inet dhcp

  2. Re: guessnet: controlling two interfaces

    On Tue, 31 Jan 2006 22:42:34 +0100, Johannes Wienke wrote:
    > Hello,
    >
    > I'm using my notebook at home and in university, so I need different
    > profiles for WLAN and LAN but I don't know how to put the configuration
    > I want to have in a script or how to do it in other ways.
    > So the thing is: When I'm at home and the network-cable is plugged in,
    > then it should use that connection and shouldn't start the
    > WLAN-interface. If there isn't a network-cable, then it has to be
    > sepparated between the differen WLAN-locations, which allready works.
    > The problem is, that when both interfaces are started, the routing
    > doesn't work. Form the /etc/interfaces below you can see, how I use
    > guessnet for WLAN at the moment. Is there any possibility to change
    > things, that it works as I described.
    >
    > Thanks
    > Johannes
    >
    > PS: Sorry for the bad English!
    >
    > --------------------------------------
    >
    > # The loopback network interface
    > auto lo
    > iface lo inet loopback
    >
    > # This is a list of hotpluggable network interfaces.
    > # They will be activated automatically by the hotplug subsystem.
    > mapping hotplug
    > script grep
    > map eth0
    >
    > auto eth1
    > iface eth1 inet static
    > address 192.168.178.102
    > netmask 255.255.255.0
    > network 192.168.178.0
    > broadcast 192.168.178.255
    > gateway 192.168.178.1
    > dns-nameservers 192.168.178.1
    >
    > auto eth0
    > mapping eth0
    > script guessnet-ifupdown
    > # Scan all logical interfaces
    > map default: none
    > map timeout: 3
    > map verbose: true
    >
    >
    > # The primary network interface
    > iface home inet static
    > address 192.168.178.202
    > netmask 255.255.255.0
    > network 192.168.178.0
    > broadcast 192.168.178.255
    > gateway 192.168.178.1
    > # wireless-* options are implemented by the wireless-tools package
    > wireless-mode managed
    > wireless-essid spiderweb
    > wireless-key1 #################
    > wireless-keymode open
    > # dns-* options are implemented by the resolvconf package, if installed
    > #dns-nameservers 192.168.178.1
    >
    > test wireless essid spiderweb
    >
    > iface unibi inet dhcp
    > wireless-mode managed
    > wireless-essid unibi
    > wireless-key off
    > wireless-ap any
    > up vpnc-connect
    > down vpnc-disconnect
    >
    > test wireless essid unibi
    >
    > iface default inet dhcp


    You could try it the way I do it. I'm running debian unstable here and I
    change my laptop from home to tmobile to work on wifi and often I am on a
    wired network with a wired card. My interfaces file looks like this

    # The loopback network interface
    auto lo
    iface lo inet loopback

    #the etho interface 3com
    auto eth0
    iface eth0 inet dhcp

    # The wifi adaptor


    iface home inet dhcp
    wireless-essid xxxxxx
    wireless-key yyyyyyyyyyyyyy

    iface tmobile inet dhcp
    wireless-essid zzzzzzz

    iface hotel inet dhcp
    wireless-essid Kimpton


    Kinda the same as yours in a few ways but the way I activate a wifi
    interface when it changes does not rely on a separate package and its
    pretty easy. Lets say I go from "home" to "tmobile" on wifi. First my
    my card is setup to do WEP at home with a certain essid and key as you
    can see from the line that says "iface home...". When I want the home
    interface up initially, I run these two commands using sudo:

    sudo ifdown ra0
    sudo ifup ra0=home

    So I get the wifi "scheme" for home which is a certain essid, key, dhcp
    managed. Now I head out and want to stop at a starbucks and do wifi
    there. I start or unsuspend my laptop and do:

    sudo ifdown ra0
    sudo ifup ra0=tmobile

    A final step with tmobile is I have to fire up a web browser and login to
    their portal site.

    I was at a hotel for awhile with abysmal wifi connectivity, but I just
    added them so I could do the same there. If I go to a new place, I do
    these commands:

    sudo iwlist scanning - this gives me a list of local wifi APs or I find
    some information in the hotel. Usually its free around the hotel so its
    pretty easy.

    sudo iwconfig ra0 essid xxxxx key off - this sets up the wifi interface
    and then I do a dhclient ra0 and get a IP address from a dhcp server.

    You can do all this with static IPs as well. I don't use any particular
    package to do roaming wifi stuff since the only one I have found that
    works for my needs is wifiswitch.

    HTH.


    --
    Michael Perry | Do or do not. There is no try. -Master Yoda
    mperry@lnxpowered.org | http://www.lnxpowered.org

+ Reply to Thread