WIMAX internet sharing with DIR-320 router, SAMSUNG U200 USB module and DD-WRT
As I was unable to find much details about such configuration, did some discovery, tried several configurations. Experience described below.
First, you need to write Yota+USB DD-WRT firmware via TFTP:
To fix this - go to "Administration" "Command" and run command (you can do this from console as well)
Then I had to restart it with my WiMAX SSID provide parameter:
WiMAX modem lamp lit, but still no internet is shared.
We we can see, there is IP assigned, but no default gateway/route.
Lets add it:
Next step - we need to share internet through other interfaces:
We can do this with iptables commands:
Ta-daaaa ! Back on-line.
This is really quick and dirty solution, which has it's limitations: after router is restarted - you need to reconfigurure everything. This include gateway calculation.
But as I wanter dd-wrt, and all the features it provides - this was helpful.
Might be a good start to someone.
Update: found WRT54G router architecture image. I assume, that it completely match DIR-320.
Step3: change permissions, make executable
Step4: add to startup via web panel (Administration-Commands-> /jffs/S02Wimax.startup)
As I was unable to find much details about such configuration, did some discovery, tried several configurations. Experience described below.
Easy way:
- Generic D-LINK DIR-320 router firmware does not support USB WiMAX.
- New D-LINK firmware do support wimax, you can download it from here. Quite stable. Only thing you need to provide is SSID for MEZON(WiMAX internet provider in my country).
Hard way:
After that,we can configure WiMAX internet.
Procedure- As I had a need for DD-WRT(which has no support directly), found some Russian WIMAX internet YOTA(www.yota.ru) provider, who "upgraded" it: added USB and WiMAX support.
- You can download their firmware image from their site.
After that,we can configure WiMAX internet.
First, you need to write Yota+USB DD-WRT firmware via TFTP:
- Connect PC and router 1st port with ethernet cable.
- Set IP address on PC to 192.168.1.3
- Router address is 192.168.1.1
- Configure TFTP client accordingly, point yota image.
- Disconnect router power cable.
- Wait while link state change to "up"
- Start TFTP server/push image to router in 2 seconds
- Restart, chose English language
Note: If this fails, try to disconnect and connect power supply to the router during first 2sec period. It will restart much faster and somehow allo tftp image to be sent.
Ater firmware installation - DD-WRT was OK, but internet was not available.
To fix this - go to "Administration" "Command" and run command (you can do this from console as well)
- /etc/init.d/S02madwimax stop
Then I had to restart it with my WiMAX SSID provide parameter:
madwimax --ssid @mezon.lt --event-script=/etc/madwimax/event.sh -doq
WiMAX modem lamp lit, but still no internet is shared.
- Checking madwimax (with "ps" command from ssh console):
- Checking if there is existing WIMAX interface with ifconfig:
We we can see, there is IP assigned, but no default gateway/route.
Lets add it:
- If interface has address is e.g. 89.117.243.109, gateway mezon'as should be on .254 address (89.117.243.254)
- Command to add it:
# route add default gw 89.117.243.254
After adding it, we get:
root@DD-WRT:~# ping 81.16.232.111
PING 81.16.232.111 (81.16.232.111): 56 data bytes
64 bytes from 81.16.232.111: seq=0 ttl=61 time=85.242 ms
64 bytes from 81.16.232.111: seq=1 ttl=61 time=57.572 ms
Next step - we need to share internet through other interfaces:
We can do this with iptables commands:
iptables -I INPUT -i vlan0 -j ACCEPT
iptables -A FORWARD -o wimax0 -i vlan0 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
Ta-daaaa ! Back on-line.
This is really quick and dirty solution, which has it's limitations: after router is restarted - you need to reconfigurure everything. This include gateway calculation.
But as I wanter dd-wrt, and all the features it provides - this was helpful.
Might be a good start to someone.
Update: found WRT54G router architecture image. I assume, that it completely match DIR-320.
Update2: with a help of jffs - automated startup.
Step0: initialize jffs
Step1: create S02Wimax.startup file:
Step2:
Paste this code from console
echo "#!/bin/sh" > S02Wimax.startup
echo "check_wimax()" >> S02Wimax.startup
echo "{" >> S02Wimax.startup
echo "sleep 30" >> S02Wimax.startup
echo "/etc/init.d/S02madwimax stop " >> S02Wimax.startup
echo "/usr/sbin/madwimax --ssid @mezon.lt --event-script=/etc/madwimax/event.sh -doq" >> S02Wimax.startup
echo "sleep 10" >> S02Wimax.startup
echo "route add default gw \$(nvram get wan_gateway_wimax)" >> S02Wimax.startup
echo "}" >> S02Wimax.startup
echo "check_wimax" >> S02Wimax.startup
Step3: change permissions, make executable
Step4: add to startup via web panel (Administration-Commands-> /jffs/S02Wimax.startup)