Linux box as wireless router?

Discussion in 'Tech Support' started by jezmck, 19 Nov 2008.

  1. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    I have cable broadband, and a separate cable modem and router.

    The wireless on the router seems to have died, I have done various tests to confirm this.

    Is there any way I can use my linux mint / ubuntu HTPC (which is the only machine next to the modem) as a wireless router?

    All the other computers are running Windows (XP/Vista).

    Any suggestions will be appreciated.
     
  2. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Sure you can, add a nic to the PC and connect it to a cheap wireless access point.

    Software wise you'll probably need just a DHCP daemon and configure IPTables (for the NAT/Forwarding/Firewall)

    After that, the sky is the limit, DNS server, (transparent) proxy, ...
     
  3. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    The HTPC has an onboard NIC and a wireless card installed now, do I need other hardware, or can I sort this out tonight?

    Ninja Edit: I'm a bit of a linux noobie, so don't assume too much!
     
  4. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    It depends on the wireless card. It has to be able to do 'master' mode.
     
  5. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    And how do I find that out?!

    It's a b43 card, but I don't know exactly what drivers it's using since it worked immediately on Linux Mint (though not on Mythbunutu, despite both being Ubunutu-based).
     
  6. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Given your card is "wlan0", try:
    Code:
    sudo ifconfig wlan0 mode master
     
  7. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    Code:
    htpc jez # iwconfig wlan0 mode master
    Error for wireless request "Set Mode" (8B06) :
        SET failed on device wlan0 ; Invalid argument.
    Looks a bit like I'm out of luck!

    PS: (for confirmation)
    Code:
    iwconfig --help
    Usage: iwconfig [interface]
                    interface essid {NNN|any|on|off}
                    interface mode {managed|ad-hoc|master|...}
    ...
     
    Last edited: 19 Nov 2008
  8. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    I know the ifconfig syntax ;) but 'man ifconfig' will tell you even more ;)

    And yes, no luck... You can still do the NIC + Wireless AP tough...

    Ninja EDIT: You didn't try it as root (with sudo), which is required...
     
  9. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    I just included the usage snipet to confirm the syntax for this version of iwconfig.

    BTW, I su'd to root, so that's not it, I think it's my hardware.
     
  10. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Ok, my bad then. Your hardware is indeed the most likely, because only a few wireless cards (which are typically clients) can do master mode. That's why I initially suggested the NIX + AP route
     
  11. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    Okay, many thanks for your help.
     
  12. capnPedro

    capnPedro Hacker. Maker. Engineer.

    Joined:
    11 Apr 2007
    Posts:
    4,381
    Likes Received:
    241
  13. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Not at all, you are bridging connections, which isn't the same as routing (NAT)
     
  14. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    Any software that I can add to help?
    Driver updates perhaps?
     
  15. Millusdk

    Millusdk What's a Dremel?

    Joined:
    27 Jan 2008
    Posts:
    140
    Likes Received:
    1
    As Glider already said, you are not running the command as root. As such it does not have the priviledges it needs to change the mode of the Wlan card.

    Run the command exactly as Glider wrote it. Including the sudo prefix. I included it here again:
    Code:
    sudo ifconfig wlan0 mode master
     
  16. notatoad

    notatoad pretty fing wonderful

    Joined:
    25 Jun 2004
    Posts:
    3,213
    Likes Received:
    60
    read his post again, he is running as the root account, sudo is unnecessary. note the prompt is a # rather than a $

    i had wondered about doing this a while back, but after 30s on google dismissed it as impossible. i should have known you could do anything with linux. does anybody know of a list of cards that will work in master mode?
     
  17. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    Also, I believe I need to use iwconfig since it's my wireless card.
     
  18. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Nope, ifconfig is the command to use. With iwconfig you set the SSID, encryption and the likes :)
     
  19. jezmck

    jezmck Minimodder

    Joined:
    25 Sep 2003
    Posts:
    4,456
    Likes Received:
    36
    Code:
    htpc jez # ifconfig wlan0 mode master
    mode: Unknown host
    ifconfig: `--help' gives usage information.
    Code:
    htpc jez # iwconfig wlan0 mode master
    Error for wireless request "Set Mode" (8B06) :
        SET failed on device wlan0 ; Invalid argument.


    I have a weirder issue though:
    Code:
    jez@htpc ~ $ sudo ls
    sudo: unable to resolve host htpc
    ...
    This has only started happening recently.
    How is it that it can't resolve itself?!

    Fortunately, it doesn't seem to stop it from doing anything.
     
  20. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    This is quite weird, as 'ls' doesn't require any resolving, it just lists the files in the current directory... Seems you have quite a borked install...
     

Share This Page