OpenWrt Forum Archive

Topic: Bridged DSL on AR7

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a DG834G.  My ISP provides bridged DSL (not ppp*).  I have 1 IP address that I get via DHCP.  If I change hardware, I have to first release the DHCP lease.

I'm almost sure that my ISP uses VPI 0 and VCI 35.

First, I set up nas0 on my router:

br2684ctl -b -c 0 -a 0.35

Before switching the cable to the new router (the old one is a wrt54g with a speedstream modem), I do

kill -s SIGUSR2 <udhcpc pid>

http://udhcp.busybox.net/README.udhcpc says SIGUSR2 releases the lease.  Upon releasing the lease, ifconfig shows the interface to no longer have an IP address.

Now that nas0 is set up on the new router, I try

udhcpc -i nas0

No response.

I ran the firewall script and set it to not start on boot (I could not confirm that this happened).

I edited /etc/config/network, adding a wan entry with the interface set to nas0 and proto to dhcp (no more settings).

I spoofed the mac address, setting it to the same one as my old router.

I kept trying reboots, still no luck.

The cable is plugged in and it is plugged in correctly to the filter.

Ideas?

(Last edited by exobyte on 5 Nov 2006, 09:57)

I found some text that may help:

Unless you have a static IP, the ISP will need some way to know who you are when you connect. There are two ways this authentication process is accomplished with DHCP. The first and most common method is via the MAC (or hardware) address of the network device. Typically this would be the NIC. The MAC address is a unique identifier and can be found among the boot messages, or with ifconfig, and looks something like 00:50:04:C2:19:BC. You will need to give the ISP the MAC address before your first connection.

The other DHCP authentication method is via an assigned hostname. In this case, the ISP will have provided you with this information. Your DHCP client will need to pass this information to the server in order for you to connect. Both dhcpcd and pump accept the "-h" command line option for this purpose. See the client's man page, or your distribution's documentation, for specifics.

Note    Note
   

If your ISP uses MAC address authentication, and you change your network device (e.g. NIC), you will need to register the new address with the ISP or you won't be able to connect.


Are you able to see any more info on logread/dmesg? etc

(Last edited by Z3r0 on 5 Nov 2006, 12:18)

Got it working!  No need to run udhcpc yourself.

All I had to do was modify /etc/config/network and run br2684ctl again:

root@OpenWrt:~# cat /etc/config/network
# Network configuration file

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.1.1
    option netmask    255.255.255.0

config interface wan
    option ifname    nas0
    option proto    dhcp
root@OpenWrt:~# br2684ctl -c 0 -e 0 -a 0.0.35
RFC1483/2684 bridge: Interface "nas0" (mtu=1500, payload=bridged) created sucessfully

RFC1483/2684 bridge: Communicating over ATM 0.0.35, encapsulation: LLC

RFC1483/2684 bridge: Interface configured
RFC1483/2684 bridge: RFC 1483/2684 bridge daemon started

I ran ifconfig immediately after br2684ctl and already had a public IP on nas0.  It was fast.  No debug showing the DHCP request or grant.

root@OpenWrt:~# dmesg
<4>CPU revision is: 00018448
<4>Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
<4>Primary data cache 16kB, 4-way, linesize 16 bytes.
<4>Linux version 2.4.32 (jason@localhost) (gcc version 3.4.6 (OpenWrt-2.0)) #2 Sun Oct 29 20:07:46 EST 2006
<4>Determined physical RAM map:
<4> memory: 00020000 @ 14000000 (ROM data)
<4> memory: 00fe0000 @ 14020000 (usable)
<4>On node 0 totalpages: 4096
<4>zone(0): 4096 pages.
<4>zone(1): 0 pages.
<4>zone(2): 0 pages.
<4>Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
<7>set_except_vector: using long jump via k0 to reach 94025200
<4>the pacing pre-scalar has been set as 600.
<7>set_except_vector: using long jump via k0 to reach 94151f40
<4>Using 75.000 MHz high precision timer.
<4>Calibrating delay loop... 149.91 BogoMIPS
<6>Memory: 14292k/16384k available (1346k kernel code, 2092k reserved, 92k data, 72k init, 0k highmem)
<6>Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
<6>Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
<6>Mount cache hash table entries: 512 (order: 0, 4096 bytes)
<6>Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
<4>Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
<4>Checking for 'wait' instruction...  available.
<4>POSIX conformance testing by UNIFIX
<6>Linux NET4.0 for Linux 2.4
<6>Based upon Swansea University Computer Society NET3.039
<4>Initializing RT netlink socket
<4>Starting kswapd
<6>devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
<6>devfs: boot_options: 0x1
<5>JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
<6>squashfs: version 3.0 (2006/03/15) Phillip Lougher
<4>pty: 256 Unix98 ptys configured
<6>Serial driver version 5.05c (2001-07-08) with no serial options enabled
<6>ttyS00 at 0xa8610e00 (irq = 15) is a 16550A
<6>ttyS01 at 0xa8610f00 (irq = 16) is a 16550A
<4>Vlynq CONFIG_AR7_VLYNQ_PORTS=2
<4>Vlynq Device vlynq0 registered with minor no 63 as misc device. Result=0
<4>Vlynq instance:0 Link UP
<4>Vlynq Device vlynq1 registered with minor no 62 as misc device. Result=0
<4>VLYNQ 1 : init failed
<6>ar7_wdt: last system reset initiated by hardware reset
<7>ar7_wdt: disabling watchdog timer
<6>ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq 62500000)
<5>ar7 flash device: 0x400000 at 0x10000000.
<5> Amd/Fujitsu Extended Query Table v1.1 at 0x0040
<5>number of CFI chips: 1
<5>cfi_cmdset_0002: Disabling fast programming due to code brokenness.
<4>Parsing ADAM2 partition map...
<4>Looking for mtd device :mtd0:
<4>Found a mtd0 image (0xd0000), with size (0x310000).
<4>Assuming default rootfs offset of 0xd0000
<4>Looking for mtd device :mtd1:
<4>Found a mtd1 image (0x20000), with size (0xb0000).
<4>Looking for mtd device :mtd2:
<4>Found a mtd2 image (0x0), with size (0x20000).
<4>Assuming adam2 size of 0x20000
<4>Looking for mtd device :mtd3:
<4>Found a mtd3 image (0x3e0000), with size (0x10000).
<4>Looking for mtd device :mtd4:
<4>Found a mtd4 image (0x3f0000), with size (0x10000).
<4>Setting new rootfs offset to 00095148
<4>Squashfs detected (size = 0xb00951bc)
<5>Creating 5 MTD partitions on "Physically mapped flash":
<5>0x00000000-0x00020000 : "adam2"
<5>0x00020000-0x003e0000 : "linux"
<5>0x00095148-0x00190000 : "rootfs"
<4>mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
<5>0x003e0000-0x00400000 : "config"
<5>0x00190000-0x003e0000 : "OpenWrt"
<6>Initializing Cryptographic API
<6>NET4: Linux TCP/IP 1.0 for NET4.0
<6>IP Protocols: ICMP, UDP, TCP, IGMP
<6>IP: routing cache hash table of 512 buckets, 4Kbytes
<6>TCP: Hash tables configured (established 1024 bind 2048)
<4>ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
<4>ip_tables: (C) 2000-2002 Netfilter core team
<6>NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
<6>NET4: Ethernet Bridge 008 for NET4.0
<6>802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
<6>All bugs added by David S. Miller <davem@redhat.com>
<4>VFS: Mounted root (squashfs filesystem) readonly.
<6>Mounted devfs on /dev
<4>Can't preserve ADAM2 memory, firstfreeaddress = 9402e088.
<4>Freeing prom memory: 128kb freed
<6>Freeing unused kernel memory: 72k freed
<4>Algorithmics/MIPS FPU Emulator v1.5
<4>jffs2.bbc: SIZE compression mode activated.
<4>Using the MAC with external PHY
<4>Cpmac driver is allocating buffer memory at init time.
<4>Using the MAC with external PHY
<4>Cpmac driver Disable TX complete interrupt setting threshold to 20.
<4>registered device TI Avalanche SAR
<4>Initializing DSL interface
<4>size=10120
<4>size=38720
<4>size=46432
<4>size=45312
<4>dsl modulation = GDMT
<4>Texas Instruments ATM driver: version:[4.02.04.00]
<4>DSL in Sync

I removed annexb from the kernel and it works now.

KillaB: I was able to leave off one of those options, and I added -b, but it worked like you said.

Z3r0: My ISP doesn't authenticate; I think I just get 1 IP address on my port.  The problems come up when a DHCP lease isn't released and I try to get a new one.

That's great that you've got it working smile

What would be the proper way to invoke /etc/hotplug.d/net/30-br2684 for bridged DSL?

Not sure what else to change except the VPI/VCI settings.

[ "${INTERFACE%%[0-9]*}" = "atm" ] && {
    case "$ACTION" in
        register)
            [ "$pppoe_atm" = 1 ] && {
                case "$atm_encaps" in
                    0|vc) ENCAPS=0 ;;
                    1|llc) ENCAPS=1 ;;
                    *) ENCAPS=0 ;;
                esac
                insmod br2684 2>&- >&-
                br2684ctl -c0 -e${ENCAPS} -a${atm_vpi:-0}.${atm_vci:-35} &
            }
        ;;
        unregister)
            killall br2684ctl 2>&- >&-
            rmmod br2684
        ;;
    esac
}

Should it done through /etc/config/network?

EDIT:  Just tried the following in build 5495 but it didn't work.

config interface    wan
    option ifname    nas0
    option proto     dhcp
    option atm       1

(Last edited by KillaB on 11 Nov 2006, 18:54)

Hey KillaB,
Maybe this will help you in terms of scripting to bring the interface up at bootup and check for loss of connection every 1min:
http://forum.openwrt.org/viewtopic.php?id=8342

all you really need to do is change the 'ps | grep pppd' to 'ps | grep br2684' and change 'ifup wan' to your 'br2684' command

hope that helps

as for invoking it to come up and down i'm pretty sure you could make a simple rc.d / init.d script

for instance
/etc/init.d/bridge
#!/bin/sh /etc/rc.common

start () {
                insmod br2684 #may need to specify full /lib/modules/2.4.33.4/br2684
                br2684ctl -c0 -a 8.35 #your command here
}

stop () {
            killall br2684ctl
            rmmod br2684
}

I think you need to chmod +x bridge first for it to work

then just do /etc/init.d/bridge start / stop etc

(Last edited by Z3r0 on 30 Nov 2006, 06:53)

The discussion might have continued from here.