Category Archives: openwrt

IPv6 on OpenWRT

A digression to set up IPv6 on OpenWRT

linksys_wrt54gl

Installing OpenWRT on Linksys WRT54GL:

1. Load OpenWRT firmware via web (Image < 3MB)

2. Set nvram parameters

nvram set boot_wait=on
nvram set boot_time=10
nvram commit && reboot

3. Install dhcp6c, radvd packages individually using opkg

To revert:

1. Erase linux kernel

mtd erase linux

2. Use tftp2.exe to reload original Linksys firmware on reboot

Links:
http://wiki.openwrt.org/oldwiki/OpenWrtDocs/Hardware/Linksys/WRT54G

http://www.andy.id.au/Home/openwrt/custom-builds

IPv6:

Linksys WRT54GL running OpenWRT "Backfire"
BusyBox v1.15.3 (2010-04-06 04:08:20 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03, r20728) --------------------------
  * 1/3 shot Kahlua    In a shot glass, layer Kahlua
  * 1/3 shot Bailey's  on the bottom, then Bailey's,
  * 1/3 shot Vodka     then Vodka.
 ---------------------------------------------------
root@OpenWrt:/etc/config# uname -a
Linux OpenWrt 2.6.32.10 #20 Tue Apr 6 15:53:48 CEST 2010 mips GNU/Linux

WAN interface is configured for dual-stack PPPoE.
root@OpenWrt:/etc/config# cat network

config 'switch' 'eth0'
        option 'enable' '1'

config 'switch_vlan' 'eth0_0'
        option 'device' 'eth0'
        option 'vlan' '0'
        option 'ports' '0 1 2 3 5'

config 'switch_vlan' 'eth0_1'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '4 5'

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 'type' 'bridge'
        option 'ifname' 'eth0.0'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.2.1'
        option 'defaultroute' '0'
        option 'peerdns' '0'

config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'pppoe'
        option 'username' 'test1@ipv6.eircom.net'
        option 'password' 'test1'
        option 'defaultroute' '1'
        option 'peerdns' '1'
        option 'ipv6' '1'

DHCP6c is the DHCPv6 client used to obtain an IPv6 prefix from the WAN

root@OpenWrt:/etc/config# cat dhcp6c

config 'dhcp6c' 'basic'
        option 'enabled' '1       # 1 = enabled
        option 'interface' 'wan'  # Interface the DHCPv6 client will run on
        option 'debug' '1'        # 1 = enabled

# Send options (1 = send; 0 = do not send)
        option 'pd' '1'           # Prefix Delegation
        option 'na' '0'           # Non-Temporary Address
        option 'rapid_commit' '0' # Rapid Commit

# Request options (1 = request; 0 = do not request)
        option 'domain_name_servers' '1'
        option 'domain_name' '0'
        option 'ntp_servers' '0'
        option 'sip_server_address' '0'
        option 'sip_domain_name' '0'
        option 'nis_server_address' '0'
        option 'nis_domain_name' '0'
        option 'nisp_server_address' '0'
        option 'nisp_domain_name' '0'
        option 'bcmcs_server_address' '0'
        option 'bcmcs_domain_name' '0'

# Define interfaces on which prefixes should be assigned

config 'interface' 'loopback'
        option 'enabled' '1'      # 1 = enabled
        option 'sla_id' '0'       # Subnet ID
        option 'sla_len' '8'      # Subnet length (64 – 56 = 8)

config 'interface' 'lan'
        option 'enabled' '1'
        option 'sla_id' '1'
        option 'sla_len' '8'

RADVD is the Router Advertisement Daemon used to assign IPv6 addresses to hosts on the LAN

root@OpenWrt:/etc/config# cat radvd
config 'interface'
        option 'interface'      'lan'
        option 'AdvSendAdvert'  '1'
        option 'AdvManagedFlag' '0'
        option 'AdvOtherConfigFlag' '1'
        option 'MaxRtrAdvInterval' '60'
        option 'AdvDefaultLifetime' '60'
        option 'ignore'         '0'

config 'prefix'
        option 'interface'      'lan'
        option 'AdvOnLink'      '1'
        option 'AdvAutonomous'  '1'
        option 'AdvRouterAddr'  '1'