📜 ⬆️ ⬇️

MultiWAN on the DIR-320

Many of my friends who work on the network, complain about their provider. As practice shows, it does not depend on the provider. Crashes happen to everyone and they happen at the most inopportune moment. Personally, I always wondered why not to connect several providers at once? With modern prices on the Internet. When I decided to connect the backup channel myself, I ran into a problem. How to distribute Internet at home with minimal financial investment?

I have long wanted to use the DIR-320, because it can be authorized in the network of my first provider using the 802.1X protocol with the new firmware. In addition, you can upload dd-wrt firmware or “firmware from Oleg”, which are essentially based on Linux. Perhaps with their help it will be possible to make 2 from 1 WAN port by default? It turned out possible.

image
Solution under the cut.
')

1. Change the firmware


First you need to fill the firmware. I chose the firmware from Oleg. Firmware from Oleg in principle for ASUS WL-500. This router is an analogue of the Asus WL-500gP V2 router with a reduced memory from 8 MB to 4 MB and without a second USB port. The router is based on the BCM5354 processor, the RAM size is 32 MB, flash is 4 megabytes, 1 USB port, 1 internal COM port. The price of this router is less than Asus routers with the same functionality. We take the firmware here: http://code.google.com/p/wl500g/downloads/list?can=2&q=wl-500gpv2 . Choose WL500gpv2-1.9.2.7-d-r2624.trx because the other one is larger and simply does not fit into the DIR. In Windows 7, we enable the tftp client: Start-> Control Panel-> Programs-> Enable or Disable Windows Components-> Put a check mark next to "TFTP Client" -> OK. For Linux, install the tftp client using the standard distribution tools, for example, for the Ubuntu family using the command in the terminal:

sudo apt-get install tftp

We create the flashing.cmd file in any text editor and save this file in the c: \ bin folder, in the same folder we put the firmware, renamed firmware.bin. Content flashing.cmd:

@Echo Off
:BEGIN
ping -n 1 -w 1 192.168.0.1
If errorlevel 1 Goto BEGIN
If errorlevel 0 Goto FLASH
Goto END

:FLASH
Echo *** Start Flashing ****
tftp -i 192.168.0.1 put c:\bin\firmware.bin

:END


Set the address of the computer network card 192.168.0.2, mask 255.255.255.0, the gateway and DNS do not need to be registered. We connect a network cable to the network card of the computer, and plug the other end of the network cable into any router's LAN port; we do not turn on the power of the router. Run the command line START-> Run-> cmd, and execute the command to go to the C \ folder: bin

C:\>cd c:\bin

Press and hold the Reset button with a well-pressed match, turn on the power of the router, all indicators will light up and as soon as they turn off the indicators, except the indicator of the LAN port to which the cable is connected, release the Reset button and immediately execute the previously typed command in the previously launched command line :

C:\bin>flashing.cmd

Observe the process of firmware.

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot

WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot

WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

192.168.0.1 32 :

.

Ping 192.168.0.1:
: = 1, = 0, = 1 (100% ),
<<>> <<>> <<>> <<>>
192.168.0.1 32 :

192.168.0.1: =32 =4 TTL=100

Ping 192.168.0.1:
: = 1, = 1, = 0 (0% ),
- :
= 4, = 4 , = 4
*** Start Flashing ****
: 3592480 11 s, 281134 /
C:\bin>

, (~1-2 ) . Reset , . Reset. . 192.168.1.1. IP ( WiFi) DHCP.

2. WAN
WAN, vlan1, vlan0. 1 LAN vlan2.

nvram set vlan0ports="2 3 4 5*"
nvram set vlan2ports="1 5"
nvram set vlan2hwname=et0
nvram set wan1_ifname=vlan1
nvram set wan2_ifname=vlan2
nvram commit
reboot


WAN.

3. 1 WAN
WAN PPPoE. . . , WAN. .

vi /tmp/local/root/options.wan0

i :

noauth refuse-eap
user 'Login_PPPoE'
password 'Pass_PPPoE'
nomppe nomppc
plugin rp-pppoe.so nic-vlan1
mru 1492 mtu 1492
maxfail 0
usepeerdns
persist
ipcp-accept-remote ipcp-accept-local noipdefault
ktune
default-asyncmap nopcomp noaccomp
novj nobsdcomp nodeflate
lcp-echo-interval 10
lcp-echo-failure 6
unit 0


Esc :wq (, w, q). Login_PPPoE Pass_PPPoE . :

pppd file /tmp/local/root/options.wan0 && sleep 15 && /sbin/udhcpc -b -i vlan1

ifconfig.

4. 2 WAN
, WAN 802.1x . wpa_supplicant roboswitch. 3 , . :

wgt wl500g.googlecode.com/files/wpa_supplicant-0.6.9-mipsel.tgz -P /tmp/local/tmp/
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/bin/wpa_supplicant.sh > /tmp/local/bin/wpa_supplicant.sh
chmod +x /tmp/local/bin/wpa_supplicant.sh
tar -xzf /tmp/local/tmp/wpa_supplicant-0.6.9-mipsel.tgz -O opt/sbin/wpa_supplicant > /tmp/local/sbin/wpa_supplicant
chmod +x /tmp/local/sbin/wpa_supplicant
vi /tmp/local/bin/wpa_supplicant.sh


wgt . i . VLAN=$(nvram get wan_ifname); export VLAN wan_ifname wan2_ifname. identity password. /opt/sbin/wpa_supplicant -i${IFNAME} -Droboswitch -c${CONF} -dd
/opt/sbin/wpa_supplicant /usr/local/sbin/wpa_supplicant -B . Esc :wq. :

flashfs save && flashfs commit && flashfs enable

/tmp/local/ /usr/local/. WAN :

/usr/local/bin/wpa_supplicant.sh && sleep 15 && /sbin/udhcpc -b -i vlan2

ifconfig.

5.
, 2 . 2 :

ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Load Balancing, :

ip route del default
ip route add default dev vlan1
ip route add default dev vlan2


6.
vi /tmp/local/sbin/post-boot

i.

#!/bin/sh
ifconfig vlan2 up
/usr/sbin/pppd file /tmp/ppp/options.wan0
sleep 15 && /sbin/udhcpc -b -i vlan1
/usr/local/bin/wpa_supplicant.sh
sleep 15 && /sbin/udhcpc -b -i vlan2
ip r add 10.152.1.0/24 dev vlan2
ip r add 31.29.0.0/16 dev vlan2


Esc :wq.

chmod +x /tmp/local/sbin/post-boot

!
PS , . DIR-320 usb-. . MultiWAN.tar . . options.wan0 wpa_supplicant.sh , . DIR-320 start.sh. .

Source: https://habr.com/ru/post/129446/


All Articles