# Netgear wg511 Howto (sort of)

## Liathus

I have been asked a few times how I got the wg511 card to work well in gentoo.  I assume that I will be asked again.  In an attempt to make this information more available I have decided to post a How-to of sorts to make the knowledge more publically available.  This method worked for me and a few others.  I don't claim that its perfect and any suggestions or updates are always helpfull.  Anyway... here it goes.

The instructions that I refere to are available at

http://ruslug.rutgers.edu/~mcgrof/802.11g/

Specifically they are under teh documentation section.  

Here are my additions and comments

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

I followed the instructions from the webpage. The only difference is that I didnt use the linux 2.4.22 pre patch, i just used vanilla-2.4.21. 

After I got all of that working i emerged pcmcia-cs. 

the real trick part was getting my card to work right on boot. 

so i made a little script like this, i called it /etc/setwireless 

```

#set wep key 

/usr/local/bin/setoid eth1 12000004 key 0 0xYOURKEY1 

/usr/local/bin/setoid eth1 12000005 key 0 0xYOURKEY2 

/usr/local/bin/setoid eth1 12000006 key 0 0xYOURKEY3 

/usr/local/bin/setoid eth1 12000007 key 0 0xYOURKEY4 

#set wep mode 

/usr/local/bin/setoid eth1 12000001 long 1 

/usr/local/bin/setoid eth1 12000002 long 1 

/usr/local/bin/setoid eth1 12000003 long 0 

/usr/local/bin/setoid eth1 12000000 long 3 

#set ssid 

/usr/local/bin/setoid eth1 10000002 ssid YOURSSID 

```

then since the wireless would be eth1, i set eth1 to dhcp in /etc/conf.d/net 

after this i copied /etc/init.d/net.eth0 to /etc/init.d/net.eth1 

i then added net.eth1 to my statrup and removed eth0 

```

rc-update add net.eth1 default 

rc-update del net.eth0 default 

```

the last thing i did was edit /etc/init.d/net.eth1 

on line 37 i inserted the command to run my wireless setup script /etc/setwireless 

make sure that the setwireless script has the right permissions. 

here is the modified net.eth1 script 

```

#!/sbin/runscript 

# Copyright 1999-2003 Gentoo Technologies, Inc. 

# Distributed under the terms of the GNU General Public License v2 

# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.28 2003/03/16 08:03:19 azarah Exp $ 

#NB: Config is in /etc/conf.d/net 

# For pcmcia users. note that pcmcia must be added to the same 

# runlevel as the net.* script that needs it. 

depend() { 

        use hotplug pcmcia 

} 

checkconfig() { 

        if [ -z "${iface_IFACE}" ] 

        then 

                eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set" 

                return 1 

        fi 

} 

setup_env() { 

        # No reason to check these multiple times in the file 

        iface_IFACE="$(eval echo \$\{iface_${IFACE}\})" 

        dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${IFACE}\})" 

        inet6_IFACE="$(eval echo \$\{inet6_${IFACE}\})" 

        alias_IFACE="$(eval echo \$\{alias_${IFACE}\})" 

        status_IFACE="$(ifconfig | gawk -v IFACE="${IFACE}" '/Link/ { if ($1 == IFACE) print "up" }')" 

} 

start() { 

        local retval=0 

        setup_env 

        checkconfig || return 1 

        #setup wireless stuff 

        #THIS IS WHERE I MADE MY CHANEGS

        /etc/setwireless 

        #END OF CHANGES

        ebegin "Bringing ${IFACE} up" 

        if [ "${iface_IFACE}" != "dhcp" ] 

        then 

                /sbin/ifconfig ${IFACE} ${iface_IFACE} >/dev/null || { 

                        retval=$? 

                        eend ${retval} "Failed to bring ${IFACE} up" 

                        return ${retval} 

                } 

                # ifconfig do not always return failure .. 

                /sbin/ifconfig ${IFACE} &> /dev/null || { 

                        retval=$? 

                        eend ${retval} "Failed to bring ${IFACE} up" 

                        return ${retval} 

                } 

        else 

                # Check that eth0 was not brough up by the kernel ... 

                if [ "${status_IFACE}" != "up" ] 

                then 

                        /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { 

                                retval=$? 

                                eend ${retval} "Failed to bring ${IFACE} up" 

                                return ${retval} 

                        } 

                fi 

        fi 

        eend 0 

        if [ -n "${alias_IFACE}" ] 

        then 

                local x="" 

                local num=0 

                local aliasbcast="" 

                local aliasnmask="" 

                ebegin "  Adding aliases" 

                for x in ${alias_IFACE} 

                do 

                        aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')" 

                        if [ -n "${aliasbcast}" ] 

                        then 

                                aliasbcast="broadcast ${aliasbcast}" 

                        fi 

                        aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')" 

                        if [ -n "${aliasnmask}" ] 

                        then 

                                aliasnmask="netmask ${aliasnmask}" 

                        fi 

                        ebegin "    ${IFACE}:${num}" 

                        /sbin/ifconfig ${IFACE}:${num} ${x} \ 

                                ${aliasbcast} ${aliasnmask} >/dev/null 

                        num=$((num + 1)) 

                        eend 0 

                done 

                save_options "alias" "${alias_IFACE}" 

        fi 

        if [ -n "${inet6_IFACE}" ] 

        then 

                local x="" 

                ebegin "  Adding inet6 addresses" 

                for x in ${inet6_IFACE} 

                do 

                        ebegin "    ${IFACE} inet6 add ${x}" 

                        /sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null 

                        eend 0 

                done 

                save_options "inet6" "${inet6_IFACE}" 

        fi 

        if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ] 

        then 

                ebegin "  Setting default gateway" 

                # First delete any existing routes if it was setup by kernel .. 

                /sbin/route del default dev ${gateway%/*} &>/dev/null 

                /sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \ 

                        netmask 0.0.0.0 metric 1 >/dev/null || { 

                        local error=$? 

                        ifconfig ${IFACE} down &>/dev/null 

                        eend ${error} "Failed to bring ${IFACE} up" 

                        stop 

                        return ${error} 

                } 

                eend 0 

        fi 

        # Enabling rp_filter causes wacky packets to be auto-dropped by 

        # the kernel 

        if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ] 

        then 

                echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter 

        fi 

} 

stop() { 

        local myalias="$(get_options alias)" 

        local myinet6="$(get_options inet6)" 

        setup_env 

        ebegin "Bringing ${IFACE} down" 

        # Also down the inet6 interfaces 

        if [ -n "${myinet6}" ] 

        then 

                local x="" 

                for x in ${myinet6} 

                do 

                        /sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null 

                done 

        fi 

        # Do some cleanup in case the amount of aliases change 

        if [ -n "${myalias}" ] 

        then 

                local x="" 

                local num=0 

                for x in ${myalias} 

                do 

                        /sbin/ifconfig ${IFACE}:${num} down >/dev/null 

                        num=$((num + 1)) 

                done 

        fi 

        if [ "${iface_IFACE}" = "dhcp" ] 

        then 

                local count=0 

                while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ] 

                do 

                        # Give dhcpcd time to properly shutdown 

                        sleep 1 

                        count=$((count + 1)) 

                done 

                if [ "${count}" -ge 9 ] 

                then 

                        eerror "Timed out trying to stop dhcpcd" 

                fi 

        else 

                /sbin/ifconfig ${IFACE} down >/dev/null 

        fi 

        eend 0 

} 

```

As you can see the changes i made are in the Start() section! 

I hope this makes sense to you... it was an undertaking... but it works perfect now! 

If you need more help let me know!

----------

## Seclar

I installed a WG511 too. I followed all the instructions at http://ruslug.rutgers.edu/~mcgrof/802.11g/Documentation/ and patched the kernel etc.

When I bring up PCMCIA I get:

```
 /etc/init.d/pcmcia start

 * Starting pcmcia...

cardmgr[1664]: watching 2 sockets                                                                                      [ ok 
```

and the laptop beeps twice and the card green light flashes.

lsmod shows the ISL module has loaded:

```
Module                  Size  Used by    Not tainted

islpci_cb              56068   2 

cb_enabler              2896   2  [islpci_cb]

ds                      7560   2  [cb_enabler]

i82365                 42080   2 

pcmcia_core            50752   0  [cb_enabler ds i82365]

eepro100               20148   1 

mii                     2448   0  [eepro100]

then starts to flash.
```

I then bring up eth1:

```
eth1      Link encap:Ethernet  HWaddr 00:09:5B:65:E9:57  

          inet addr:192.168.0.21  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:9 Base address:0x2000 Memory:e19ab000-e19ad000 

```

and try to set my SSID to OFFICE:

```
setoid eth1 10000002 ssid OFFICE
```

and I get this:

```

Cannot open prism traps netlink socket: Protocol not supported

Cannot open prism traps netlink socket: Protocol not supported

Could not close prismoid netlink socket: Bad file descriptor

```

Any ideas?

----------

## Seclar

I installed a WG511 too. I followed all the instructions at http://ruslug.rutgers.edu/~mcgrof/802.11g/Documentation/ and patched the kernel etc.

When I bring up PCMCIA I get:

```
 /etc/init.d/pcmcia start

 * Starting pcmcia...

cardmgr[1664]: watching 2 sockets                                                                                      [ ok 
```

and the laptop beeps twice and the card green light flashes.

lsmod shows the ISL module has loaded:

```
Module                  Size  Used by    Not tainted

islpci_cb              56068   2 

cb_enabler              2896   2  [islpci_cb]

ds                      7560   2  [cb_enabler]

i82365                 42080   2 

pcmcia_core            50752   0  [cb_enabler ds i82365]

eepro100               20148   1 

mii                     2448   0  [eepro100]

then starts to flash.
```

I then bring up eth1:

```
eth1      Link encap:Ethernet  HWaddr 00:09:5B:65:E9:57  

          inet addr:192.168.0.21  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:9 Base address:0x2000 Memory:e19ab000-e19ad000 

```

and try to set my SSID to OFFICE:

```
setoid eth1 10000002 ssid OFFICE
```

and I get this:

```

Cannot open prism traps netlink socket: Protocol not supported

Cannot open prism traps netlink socket: Protocol not supported

Could not close prismoid netlink socket: Bad file descriptor

```

Any ideas?

----------

## Seclar

I installed a WG511 too. I followed all the instructions at http://ruslug.rutgers.edu/~mcgrof/802.11g/Documentation/ and patched the kernel etc.

When I bring up PCMCIA I get:

```
 /etc/init.d/pcmcia start

 * Starting pcmcia...

cardmgr[1664]: watching 2 sockets                                                                                      [ ok 
```

and the laptop beeps twice and the card green light flashes.

lsmod shows the ISL module has loaded:

```
Module                  Size  Used by    Not tainted

islpci_cb              56068   2 

cb_enabler              2896   2  [islpci_cb]

ds                      7560   2  [cb_enabler]

i82365                 42080   2 

pcmcia_core            50752   0  [cb_enabler ds i82365]

eepro100               20148   1 

mii                     2448   0  [eepro100]

then starts to flash.
```

I then bring up eth1:

```
eth1      Link encap:Ethernet  HWaddr 00:09:5B:65:E9:57  

          inet addr:192.168.0.21  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:9 Base address:0x2000 Memory:e19ab000-e19ad000 

```

and try to set my SSID to OFFICE:

```
setoid eth1 10000002 ssid OFFICE
```

and I get this:

```

Cannot open prism traps netlink socket: Protocol not supported

Cannot open prism traps netlink socket: Protocol not supported

Could not close prismoid netlink socket: Bad file descriptor

```

Any ideas?

----------

## Seclar

I installed a WG511 too. I followed all the instructions at http://ruslug.rutgers.edu/~mcgrof/802.11g/Documentation/ and patched the kernel etc.

When I bring up PCMCIA I get:

```
 /etc/init.d/pcmcia start

 * Starting pcmcia...

cardmgr[1664]: watching 2 sockets                                                                                      [ ok 
```

and the laptop beeps twice and the card green light flashes.

lsmod shows the ISL module has loaded:

```
Module                  Size  Used by    Not tainted

islpci_cb              56068   2 

cb_enabler              2896   2  [islpci_cb]

ds                      7560   2  [cb_enabler]

i82365                 42080   2 

pcmcia_core            50752   0  [cb_enabler ds i82365]

eepro100               20148   1 

mii                     2448   0  [eepro100]

then starts to flash.
```

I then bring up eth1:

```
eth1      Link encap:Ethernet  HWaddr 00:09:5B:65:E9:57  

          inet addr:192.168.0.21  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:9 Base address:0x2000 Memory:e19ab000-e19ad000 

```

and try to set my SSID to OFFICE:

```
setoid eth1 10000002 ssid OFFICE
```

and I get this:

```

Cannot open prism traps netlink socket: Protocol not supported

Cannot open prism traps netlink socket: Protocol not supported

Could not close prismoid netlink socket: Bad file descriptor

```

Any ideas?

----------

## Seclar

I installed a WG511 too. I followed all the instructions at http://ruslug.rutgers.edu/~mcgrof/802.11g/Documentation/ and patched the kernel etc.

When I bring up PCMCIA I get:

```
 /etc/init.d/pcmcia start

 * Starting pcmcia...

cardmgr[1664]: watching 2 sockets                                                                                      [ ok 
```

and the laptop beeps twice and the card green light flashes.

lsmod shows the ISL module has loaded:

```
Module                  Size  Used by    Not tainted

islpci_cb              56068   2 

cb_enabler              2896   2  [islpci_cb]

ds                      7560   2  [cb_enabler]

i82365                 42080   2 

pcmcia_core            50752   0  [cb_enabler ds i82365]

eepro100               20148   1 

mii                     2448   0  [eepro100]

then starts to flash.
```

I then bring up eth1:

```
eth1      Link encap:Ethernet  HWaddr 00:09:5B:65:E9:57  

          inet addr:192.168.0.21  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:9 Base address:0x2000 Memory:e19ab000-e19ad000 

```

and try to set my SSID to OFFICE:

```
setoid eth1 10000002 ssid OFFICE
```

and I get this:

```

Cannot open prism traps netlink socket: Protocol not supported

Cannot open prism traps netlink socket: Protocol not supported

Could not close prismoid netlink socket: Bad file descriptor

```

Any ideas?

----------

## Liathus

 *Seclar wrote:*   

> 
> 
> and try to set my SSID to OFFICE:
> 
> ```
> ...

 

That almost looks like the kernel patch didnt get applied correctly...   have you had any luck with getting this resolved?

----------

