OpenWrt Forum Archive

Topic: Using dropbear and tun to tunnel traffic through router

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to get this working on Kamikaze 8.09
Because I wasn't able to find any PermitTunnel (or similiar) option in dropbear I just simply skipped that part. When I connect to dropbear using sudo ssh -w any:any 192.168.1.1 I get a connection, but neither my server nor my client get a tunX device. tun is loaded for both server and client. Am I doing something wrong, is there a PermitTunnel option for dropbear, that I missed or is dropbear not capable of what I'm trying to do?

PS: I've just stumpled upon this:

Second: You need OpenSSH at least version 4.3. I'll use version 4.3p2 for this HowTo.

This might be the problem :-/

PPS:
When trying to install openssh-sever I get:

* Only have 1024 available blocks on filesystem /, pkg libopenssl needs 1257

I'll need to build a custom image to get openssh fit onto my WRT54G, or? Is there somewhere a list of optional packages that I can freely drop from my image? I need WPA2 WLAN and I'm connected through DSL so I need pppoe (that's what I've seen suggested in another thread). I'd rather also keep luci, because sometimes it simply makes my life easier (I'm no Linux guru), but might also drop it if there's no other good option - and learn how to administer OpenWRT through shell wink

PPPS:
Ok, I decided I'm going to build Kamikaze 8.09 myself. I'm not sure however which packages I need and which not. I used the BRCM profile + target from within make menuconfig and compared the selected packages with those currently installed an my router (opkg list_installed). I found most packeges where selected. However, some wheren't and some which where selected aren't currently installed on my router.

Packages which are currently installed but not selected:
hostapd-mini
hotplug2
kmod-crypto-core
kmod-crypto-aes
kmod-crypto-arc4
kmod-b43 (did not even find it in the configuration menu)
ppp-mod-pppoe (did not find it in configuration menu)
udevtrigger (did not find it in configuration menu)
mac80211 (did not find it in configuration menu)
luci-* (not in menu either, but never mind that stuff)
lua + liblua (I suppose luci depends on them)

Packets selected in the configuration menu, but not currently installed on my router:

Some BRCM packets from the propieratary kernel module drivers (can't recall exact names currently)

Additionally I want kmod-tun and openssh server installed. If I install openssh server I don't have to install dropbear, right?
Why are the packets up there not selected by default? Some of the seem rather important (for a wifi router) eg hotplug2 or hostapd-mini.
And do I really need those kernel module drivers that are currently not installed on my router?

When I have built my image I suppose the best way to flash it is using mtd, right? One thing I currently cannot figure out though is how I will get my image from my laptop to my router? I could certainly wget it, but I'd need a webserver for that. Is there another way I'm currently missing?

(Last edited by dev0 on 1 Nov 2009, 05:00)

Ok, a reply this time, to keep some structure. Just for the records: I'm doing this on a WRT54GL 1.1

I built Kamikaze 8.09 using Broadcom BCM947xx/953xx [2.6] as target and Broadcom BCM43xx Wifi as profile. I decided to not include luci to free up space. I figured out, that choosing the 2.6 target would "fix" alot of my missing packages that used to be installed on my router. I added kmod-tun and openssh-server + openssh-client. I then removed dropbear because I wouldn't need it anymore with openssh installed. I've also chosen hostapd and hostapd-utils instead of hostapd-mini, because I might need WEP sometimes. I don't really know if I'll need hostapd-utils, but since I have plenty of space left without luci I added it.
When it comes to the wireless drivers though I'm not sure what to install. I ran ./scripts/feeds install kmod-b43; ./scripts/feeds install b43 to get that b43 module that was loaded in my old install and it did get something. I wasn't able to pinpoint it though in the menu configuration. I supposed it's the kmod-net-bcm43xx package, but I wasn't sure. So I simply installed kmod-mac80211 and kmod-net-bcm43xx. If I'm not wrong that are all the modifcations I've done to the image. I compiled it and flashed it to my router (I figured out I can use scp to copy the image to the router). Everything seems to work fine except wifi. Stupid as I am, I forgot to save my wireless configurations. However, I tried to manually configuring the wifi adapter using the documentation. I wasn't sure which driver to choose (mac80211 or broadcom) so I tried both. When I use the broadcom driver it gives me an device not supported error message when reloading the configuration files. When I use the mac80211 driver this message does not appear, but instead it seems like if the configuration of the device (which I called wifi0) will fail, because the device is not present (alot of errors stating this, after reloading the network configuration). If I check with ifconfig -a there's no wifi0 device. I suppose the mac80211 driver is the right one, but I don't know why the wifi0 device is not created. Here is my wireless configuration I used to test my wifi:

config wifi-device wifi0
        option type mac80211
        option channel 5

config wifi-iface
        option device wifi0
        option mode ap
        option network lan
        option ssid 'OpenWrt'
        option hidden 0
        option encryption none

One thing that got me thinking though is that lsmod | grep b43 gives me nothing and even opkg update && opkg list | grep b43 gives me nothing. Where is that kmod-b43 package gone and do I need it?!
Another thing that might be interesting is that after flashing my /etc/config/wireless file was completely empty, although the documentation states, that their should be a dummy configuration if the router successfully identified my wifi chip - which I suppose it didn't.

I really don't know any further at this point. I'd really appreciate some hints what I'm doing wrong and how to get my wifi back up running. Thanks for your effort upfront!

PS: I tried switching the interface name to wlan0 and adding the option disabled 0. Both didn't help.

(Last edited by dev0 on 1 Nov 2009, 16:56)

Ok, after sn9 in freenodeirc:#openwrt told me to try building the current kamikaze trunk I did so and wireless functionality is now present (woohoooo, thank you sn9). However pppoe mocks now. I cannot connect to the internet through my WRT54GL anymore. readlog tells me after ifup wan:

Plugin rp-pppoe.so loaded.
Timeout waiting for PADS packets
Unable to complete PPPoE Discovery
Terminating on signal 15
Plugin rp-pppoe.so loaded.

My /etc/config/network configuration is:

cat /etc/config/network
#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option 'ifname' 'eth0.1'
        option 'proto' 'pppoe'
        option 'username' 'a_username'
        option 'password' 'a_password'

My modem is properly connected to my router on the internet port.
Because this is a custom built image my first thought was I might miss a crucial package, so here's opkg list_installed:

base-files - 33-r18258 -
busybox - 1.14.4-1 -
dnsmasq - 2.50-2 -
firewall - 1-8 -
hostapd - 0.6.9-1 -
hostapd-utils - 0.6.9-1 -
hotplug2 - 1.0-beta-1 -
iptables - 1.4.4-2 -
iptables-mod-conntrack - 1.4.4-2 -
iptables-mod-nat - 1.4.4-2 -
iw - 0.9.17-1 -
kernel - 2.6.30.9-1 -
kmod-b43 - 2.6.30.9+2009-10-09-1 -
kmod-b43legacy - 2.6.30.9+2009-10-09-1 -
kmod-crc-ccitt - 2.6.30.9-1 -
kmod-crypto-aes - 2.6.30.9-1 -
kmod-crypto-arc4 - 2.6.30.9-1 -
kmod-crypto-core - 2.6.30.9-1 -
kmod-diag - 2.6.30.9-5 -
kmod-ipt-conntrack - 2.6.30.9-1 -
kmod-ipt-core - 2.6.30.9-1 -
kmod-ipt-nat - 2.6.30.9-1 -
kmod-ipt-nathelper - 2.6.30.9-1 -
kmod-mac80211 - 2.6.30.9+2009-10-09-1 -
kmod-ppp - 2.6.30.9-1 -
kmod-pppoe - 2.6.30.9-1 -
kmod-switch - 2.6.30.9-2 -
kmod-tun - 2.6.30.9-1 -
libc - 0.9.30.1-33 -
libgcc - 4.3.3+cs-33 -
libiptc - 1.4.4-2 -
liblua - 5.1.4-5 -
libnl-tiny - 0.1-1 -
libopenssl - 0.9.8k-2 -
libuci - 0.7.5-1 -
libuci-lua - 0.7.5-1 -
libxtables - 1.4.4-2 -
lua - 5.1.4-5 -
mtd - 10 -
nvram - 5 -
openssh-client - 5.2p1-1 -
openssh-server - 5.2p1-1 -
opkg - 215-3 -
ppp - 2.4.4-4 -
ppp-mod-pppoe - 2.4.4-4 -
uci - 0.7.5-1 -
ucitrigger - 0.7.5-1 -
udevtrigger - 106-1 -
wireless-tools - 29-4 -
zlib - 1.2.3-5 -

I'd say ppp, ppp-mod-pppoe should do the job, however, I'm not really into this. I'd really appreciate some suggestions. I searched the forum and found at least one person with the same problem, but besides checking the modem connection there wasn't much hints there.

Thank you!

The discussion might have continued from here.