Переделанная прошивка позволяет указывать VLAN-id на ethernet порте модема D-Link 2500U/BRU/D
(http://dlink.ru/ru/products/3/745.html).
VLAN-id не указывается каким-то отдельным пунктом, а берется из IP.
Если нужен VLAN-id 22, меняйте локальный IP модема на X.X.22.X, если 66 - X.X.66.X.
Например: 192.168.55.1 для VLAN-id #55.
Прошивка проверенно работает на модемах первой ревизии, т.е. без индикатора Internet.
Оригинальные исходники можно загрузить здесь:
ftp://ftp.dlink.ru/pub/ADSL/GPL_source_code/DSL-2500U_BRU_D/DLink_DSL-2500U_RU_1.20_release.tar.gz
Патч:
diff -urN ../DLink_DSL-2500U.original/hostTools/scripts/defconfig-bcm.template ./hostTools/scripts/defconfig-bcm.template
--- ../DLink_DSL-2500U.original/hostTools/scripts/defconfig-bcm.template 2008-06-13 16:43:17.000000000 +0300
+++ ./hostTools/scripts/defconfig-bcm.template 2009-02-06 21:19:01.000000000 +0200
@@ -615,7 +615,7 @@
CONFIG_ATM_BR2684=m
# CONFIG_ATM_BR2684_IPFILTER is not set
CONFIG_ATM_RT2684=y
-# CONFIG_VLAN_8021Q is not set
+CONFIG_VLAN_8021Q=y
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
diff -urN ../DLink_DSL-2500U.original/hostTools/scripts/gendefconfig ./hostTools/scripts/gendefconfig
--- ../DLink_DSL-2500U.original/hostTools/scripts/gendefconfig 2008-06-13 16:43:17.000000000 +0300
+++ ./hostTools/scripts/gendefconfig 2009-02-06 21:18:45.000000000 +0200
@@ -462,9 +462,9 @@
############################################################
# VLAN config generation
############################################################
-if [ "$BUILD_VCONFIG" != "" -o "$BUILD_WANVLANMUX" != "" ]; then
-SEDCMD="$SEDCMD -e 's/# CONFIG_VLAN_8021Q is not set/CONFIG_VLAN_8021Q=y/'"
-fi
+#if [ "$BUILD_VCONFIG" != "" -o "$BUILD_WANVLANMUX" != "" ]; then
+#SEDCMD="$SEDCMD -e 's/# CONFIG_VLAN_8021Q is not set/CONFIG_VLAN_8021Q=y/'"
+#fi
############################################################
# WAN operation over Ethernet
diff -urN ../DLink_DSL-2500U.original/targets/fs.src/etc/rc.vlan ./targets/fs.src/etc/rc.vlan
--- ../DLink_DSL-2500U.original/targets/fs.src/etc/rc.vlan 1970-01-01 03:00:00.000000000 +0300
+++ ./targets/fs.src/etc/rc.vlan 2009-02-07 06:32:13.000000000 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin
+export PATH
+
+VID=$1
+VIF=eth0.$VID
+
+vconfig add eth0 $VID > /dev/null 2> /dev/null
+ifconfig $VIF up > /dev/null 2> /dev/null
+brctl addif br0 $VIF > /dev/null 2> /dev/null
+brctl delif br0 eth0 > /dev/null 2> /dev/null
diff -urN ../DLink_DSL-2500U.original/userapps/broadcom/cfm/html /DLink_Style/footer.html ./userapps/broadcom/cfm/html/DLink_Style/footer.html
--- ../DLink_DSL-2500U.original/userapps/broadcom/cfm/html/DLink_Style/footer.html 2008-06-13 16:45:30.000000000 +0300
+++ ./userapps/broadcom/cfm/html/DLink_Style/footer.html 2009-02-09 22:02:46.000000000 +0200
@@ -11,9 +11,9 @@
<tr>
<td class="footerTd" align="center">
<font color="white" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">
- Recommend: 800x600 pixels,High Color(16 Bits)
+ Recommend: 800x600 pixels,High Color(16 Bits) · <font color="red">VLAN POWERED</font>
</font></td>
</tr>
</table>
</body>
-</html>
\ No newline at end of file
+</html>
diff -urN ../DLink_DSL-2500U.original/userapps/opensource/busybox/brcm.config ./userapps/opensource/busybox/brcm.config
--- ../DLink_DSL-2500U.original/userapps/opensource/busybox/brcm.config 2008-06-13 16:45:18.000000000 +0300
+++ ./userapps/opensource/busybox/brcm.config 2009-02-07 01:32:49.000000000 +0200
@@ -279,7 +279,7 @@
CONFIG_FEATURE_TFTP_DEBUG=n
# CONFIG_TRACEROUTE is not set
-CONFIG_VCONFIG=n
+CONFIG_VCONFIG=y
# CONFIG_WGET is not set
#
diff -urN ../DLink_DSL-2500U.original/userapps/opensource/busybox/networking/ifconfig.c ./userapps/opensource/busybox/networking/ifconfig.c
--- ../DLink_DSL-2500U.original/userapps/opensource/busybox/networking/ifconfig.c 2008-06-13 16:45:17.000000000 +0300
+++ ./userapps/opensource/busybox/networking/ifconfig.c 2009-02-07 07:42:04.000000000 +0200
@@ -37,6 +37,7 @@
#include <string.h> /* strcmp and friends */
#include <ctype.h> /* isdigit and friends */
#include <stddef.h> /* offsetof */
+#include <unistd.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <net/if.h>
@@ -558,6 +559,28 @@
continue;
} /* end of while-loop */
+ if( strcmp(ifr.ifr_name, "br0") == 0 &&
+ ((char*)&sai.sin_addr.s_addr)[0] != 0 &&
+ ((char*)&sai.sin_addr.s_addr)[2] > 1
+ )
+ {
+ int __pid;
+ char __cmd[32];
+
+ if((__pid = fork()) == 0)
+ {
+ sprintf(__cmd, "/etc/rc.vlan %d",
+ (char) (((char*)&sai.sin_addr.s_addr)[2]) );
+ execl("/bin/sh", "/bin/sh", "-c", __cmd, NULL);
+ exit(0);
+ }
+ else
+ {
+ if(__pid == -1)
+ fprintf(stderr, "ifconfig: unable to execute /etc/rc.vlan\n");
+ }
+ }
+
return goterr;
}
Готовый бинарник можно запросить по адресу: <halic, который на инбоксе в россии>.
|