PDA

Bekijk de volledige versie : Overlay of WAN and LAN at the same time



medium.net
01-04-2005, 01:11
Hello,

WL-300g users might have the problem that their sole LAN port might be either used as IP-over-Ethernet port or as Internet-Access-over-Ethernet port (i.e. PPPoE port), but not both.

If you wanted to dial up using PPPoE and, at the same time, bridge the WLAN interface with the LAN interface, you were AFAIK out of luck.

But I've made a patch to make this work. This is how it is done:


(1) Apply this to "src/broadcom/gateway":


--- rc/network.c.orig.0 2005-01-05 00:11:38.000000000 +0100
+++ rc/network.c 2005-04-01 00:00:32.000000000 +0200
@@ -584,8 +584,14 @@
* ip-up/ip-down scripts upon link's connect/disconnect.
*/
if (strcmp(wan_proto, "pppoe") == 0) {
+ char * wan_ifname_pppoe = nvram_get(strcat_r(prefix, "ifname_pppoe", tmp));
+
+ if (wan_ifname_pppoe==NULL) {
+ wan_ifname_pppoe = nvram_safe_get(strcat_r(prefix, "ifname", tmp));
+ }
+
char *pppoe_argv[] = { "pppoecd",
- nvram_safe_get(strcat_r(prefix, "ifname", tmp)),
+ wan_ifname_pppoe,
"-u", nvram_safe_get(strcat_r(prefix, "pppoe_username", tmp)),
"-p", nvram_safe_get(strcat_r(prefix, "pppoe_passwd", tmp)),
"-r", nvram_safe_get(strcat_r(prefix, "pppoe_mru", tmp)),


(2) update the device firmware respectively
(3) nvram set wan0_ifname_pppoe=br0
(4) nvram commit
(5) edit your /usr/local/sbin/post-boot to additionally contain "brctl addif br0 eth0"
(6) flashfs save
(7) flashfs commit
(8) use the same settings "IP Config/WAN & LAN/WAN IP Setting" and "IP Config/WAN & LAN/LAN IP Setting"
(9) reboot and have fun.

Oleg, it would be nice if you added this patch to your development tree (e.g. 1.9.2.7-5 or so)

medium.net
01-04-2005, 04:13
This is the correct patch for 1.9.2.7-4, the former patch was for 1.9.2.7-2.


------ rc/network_ex.c 2005-04-01 04:33:02.000000000 +0200
+++ ../gateway.1.9.2.7-4.changed/rc/network_ex.c 2005-04-01 04:22:17.000000000 +0200
@@ -139,7 +139,13 @@

if (nvram_match(strcat_r(prefix, "proto", tmp), "pppoe"))
{
- fprintf(fp, "plugin rp-pppoe.so %s\n", nvram_safe_get(strcat_r(prefix, "ifname", tmp)));
+ char * wan_ifname_pppoe = nvram_get(strcat_r(prefix, "ifname_pppoe", tmp));
+
+ if (wan_ifname_pppoe==NULL) {
+ wan_ifname_pppoe = nvram_safe_get(strcat_r(prefix, "ifname", tmp));
+ }
+
+ fprintf(fp, "plugin rp-pppoe.so nic-%s\n", wan_ifname_pppoe);

fprintf(fp, "mru %s\n", nvram_safe_get(strcat_r(prefix, "pppoe_mru", tmp)));
fprintf(fp, "mtu %s\n", nvram_safe_get(strcat_r(prefix, "pppoe_mtu", tmp)));

Note that this also fixes a bug in calling "rp-pppoe.so", because to specify devices with arbitrary name, "nic-" has to be prependet to that name in order to make "rp-pppoe.so" recognize that word as a network device name.

ela002
01-04-2005, 22:09
With the WAN LAN bridge you can use the same network for WAN and LAN? Please release a new firmware with this update :D

ela002
02-04-2005, 12:58
Because I don't have linux, can somebody compile a firmware with that patch? :rolleyes:

Oleg
02-04-2005, 14:34
This patch would not solve your problem.

medium.net
08-04-2005, 21:54
This patch would not solve your problem.
Why not, when also doing as the supplied instructions do suggest?

With this patch, your PPPoE DSL modem may even reside at the WLAN side of the bridge, not only at the LAN side. Both ethernet interfaces are bridged together, using PPPoE over this bridged ethernet.

Oleg
08-04-2005, 22:06
Why not, when also doing as the supplied instructions do suggest?

With this patch, your PPPoE DSL modem may even reside at the WLAN side of the bridge, not only at the LAN side. Both ethernet interfaces are bridged together, using PPPoE over this bridged ethernet.
This was a comment to ela002 post. :)