Hi all,
how should I setup my DIR-300 for client routed mode?
Here is my network:
internet------Asus WL-500gp AP ---wifi--->(dhcp 192.168.1.162)D-Link DIR-300 ---ether LAN----> PC Client 192.168.2.200
192.168.1.1 192.168.2.1
and DIR-300 configuration:
root@OpenWrt:/etc/config# cat dhcp
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp wan
option interface wan
option start 100
option limit 150
option leasetime 12h
root@OpenWrt:/etc/config# cat network
# Copyright (C) 2006 OpenWrt.org
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface lan
option ifname eth0
option proto static
option ipaddr 192.168.2.1
option netmask 255.255.255.0
config interface wan
option ifname ath0
option proto static
option ipaddr 192.168.1.162
option netmask 255.255.255.0
option gateway 192.168.1.1
option dns 192.168.1.1
root@OpenWrt:/etc/config# cat wireless
config wifi-device wifi0
option type atheros
option channel auto
config wifi-iface
option device wifi0
option network wan
option mode sta
root@OpenWrt:/etc/config# cat wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="AVALON"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="testtest"
}
after booting I'm running this small script to establish a wireless connection to Asus AP:
root@OpenWrt:/etc/init.d# cat wpa
#!/bin/sh
iwconfig ath0 essid AVALON ap 00:1A:92:7E:27:2E
wpa_supplicant -c /etc/config/wpa_supplicant.conf -iath0 -B -Dmadwifi
echo "waiting for WPA connect..."
check_wpa_connection() {
wpa_connection_complete=`wpa_cli status | grep ^wpa_stat | awk -F= 'BEGIN { complete=0; } { if ($2 == "COMPLETED") complete=1; } END { print complete }'`
}
check_wpa_connection
while [ $wpa_connection_complete = 0 ]; do
echo "still waiting until WPA connection is complete (sleeping for 5 seconds)..."
sleep 5
check_wpa_connection
done
here is the routing table:
root@OpenWrt:/etc/init.d# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 ath0
default 192.168.1.1 0.0.0.0 UG 0 0 0 ath0
and ifconfig, iwconfig, iptables
root@OpenWrt:/etc/init.d# ifconfig
ath0 Link encap:Ethernet HWaddr 00:21:91:34:75:57
inet addr:192.168.1.162 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3152 (3.0 KiB) TX bytes:1827 (1.7 KiB)
eth0 Link encap:Ethernet HWaddr 00:21:91:34:75:58
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:506 errors:0 dropped:0 overruns:0 frame:0
TX packets:314 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52114 (50.8 KiB) TX bytes:42352 (41.3 KiB)
Interrupt:4 Base address:0x1000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wifi0 Link encap:UNSPEC HWaddr 00-21-91-34-75-57-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5963 errors:0 dropped:0 overruns:0 frame:241
TX packets:803 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:195
RX bytes:822703 (803.4 KiB) TX bytes:38325 (37.4 KiB)
Interrupt:3 Memory:b0000000-b00ffffc
root@OpenWrt:/etc/init.d# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
wifi0 no wireless extensions.
ath0 IEEE 802.11g ESSID:"AVALON" Nickname:""
Mode:Managed Frequency:2.412 GHz Access Point: 00:1A:92:7E:27:2E
Bit Rate:36 Mb/s Tx-Power:17 dBm Sensitivity=1/1
Retry:off RTS thr:off Fragment thr:off
Encryption key:C317-B93F-01EC-DEA1-412F-3ECA-5B56-8791 Security mode:restricted
Power Management:off
Link Quality=82/70 Signal level=-14 dBm Noise level=-96 dBm
Rx invalid nwid:2389 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
root@OpenWrt:/etc/init.d# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
but the traffic from ath0 to eth0 and v.v. is not routed
is it possible that the downloaded 8.09RC openwrt-atheros-vmlinux.lzma has no routing option compiled?...