Thanks LocalHoser. Your post helped me setup my router. I'll add some more info onto this thread for the next person.
You can find how to get your DSL username and password on other posts, like this one.
I'm using a Netgear WNDR3800, because of it's small size. It's sitting inside a patch panel in a wall of my house. The stock CenturyLink modem is too big and doesn't fit.
I'm running an ath79 build to get flow offloading.
For my router, the network/switch page doesn't list the wan port:
So I just typed in eth1.201 as a custom interface, and it worked!
My internet connection is gigabit fiber, but the router can't keep up. Before I enabled flow offloading, here's what I was getting for IPv4 speed tests:
And here's IPv6 (I'll explain how to enable it later)
I turned on software flow offloading under Network > Firewall > General Settings. I also turned on Hardware flow offloading, but that doesn't seem to make a difference in the performance tests.
After doing that, I was able to keep viewing most webpages. I immediately got much better download rates in speed tests, but for the upload test, it would hang at 0%. After a lot of trial and error, I figured out it was an MTU problem. Lowering the MTU to 1492 on my Linux machine fixed the upload. I added the mtu limit as a DHCP option. The Linux DHCP clients behind the router picked it up and it worked. However, the Roku boxes on my network couldn't reach Netflix. I'm guessing the Roku boxes didn't honor the MTU from the DHCP lease, but I didn't take sniffs to verify.
So instead of lowering the MTU on the clients, I raised the MTU on the router. I used ifconfig
inside the router to temporarily adjust the MTU for eth1 and eth1.201. ifconfig
could set the MTU up to 1516, but would return errors if I went any higher. I couldn't find any LuCI GUI way to permanently change the MTU, so I had to edit /etc/config/network
directly and add this to the top:
config device
option name 'eth1'
option mtu '1516'
config device
option name 'eth1.201'
option mtu '1516'
I also overwrote the MTU on the WAN network interface page. Although I'm not sure if this set is required:
After rebooting the router so it would apply the network changes, I verified the MTU using ifconfig:
br-lan Link encap:Ethernet HWaddr 2C:B0:5D:7F:47:BB
inet addr:192.168.15.1 Bcast:192.168.15.255 Mask:255.255.255.0
inet6 addr: fe80::2eb0:5dff:fe7f:47bb/64 Scope:Link
inet6 addr: 2602:ae:1543:b900::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63424002 errors:0 dropped:8 overruns:0 frame:0
TX packets:49226878 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10756886892 (10.0 GiB) TX bytes:31481200458 (29.3 GiB)
eth0 Link encap:Ethernet HWaddr 2C:B0:5D:7F:47:BB
inet6 addr: fe80::2eb0:5dff:fe7f:47bb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63424040 errors:0 dropped:0 overruns:201 frame:0
TX packets:49226892 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3308591045 (3.0 GiB) TX bytes:1613338330 (1.5 GiB)
Interrupt:4
eth0.1 Link encap:Ethernet HWaddr 2C:B0:5D:7F:47:BB
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63424002 errors:0 dropped:0 overruns:0 frame:0
TX packets:49226878 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10756886892 (10.0 GiB) TX bytes:31481200458 (29.3 GiB)
eth1 Link encap:Ethernet HWaddr 2C:B0:5D:7F:47:BC
inet6 addr: fe80::2eb0:5dff:fe7f:47bc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1516 Metric:1
RX packets:47277175 errors:0 dropped:0 overruns:1388 frame:0
TX packets:61415432 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1623006881 (1.5 GiB) TX bytes:3429836415 (3.1 GiB)
Interrupt:5
eth1.201 Link encap:Ethernet HWaddr 2C:B0:5D:7F:47:BC
inet6 addr: fe80::2eb0:5dff:fe7f:47bc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1516 Metric:1
RX packets:47241940 errors:0 dropped:0 overruns:0 frame:0
TX packets:61415425 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30835308933 (28.7 GiB) TX bytes:11774108481 (10.9 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:851424 errors:0 dropped:0 overruns:0 frame:0
TX packets:851424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:71163376 (67.8 MiB) TX bytes:71163376 (67.8 MiB)
pppoe-wan Link encap:Point-to-Point Protocol
inet addr:174.21.67.185 P-t-P:63.231.10.66 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
RX packets:47237235 errors:0 dropped:0 overruns:0 frame:0
TX packets:61410713 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:30457212707 (28.3 GiB) TX bytes:10422930833 (9.7 GiB)
My internet connection has been stable after increasing the MTU like that. Although it still seems that only up to MTU 1492 works for devices behind the router:
[kyle@ryoko ~]$ ping -M do -s 1464 8.8.8.8 -c1 -w1
PING 8.8.8.8 (8.8.8.8) 1464(1492) bytes of data.
1472 bytes from 8.8.8.8: icmp_seq=1 ttl=122 time=2.73 ms
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.735/2.735/2.735/0.000 ms
[kyle@ryoko ~]$ ping -M do -s 1466 8.8.8.8 -c1 -w1
PING 8.8.8.8 (8.8.8.8) 1466(1494) bytes of data.
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
Here's my IPv4 performance with the flow offloading:
And IPv6
Based on the top output from inside the router,
I'm fairly certain I'm getting limited by the router's CPU, not the ISP. Here's top output from inside the router during the IPv4 download test:
Mem: 34848K used, 89352K free, 712K shrd, 2200K buff, 8248K cached
CPU: 0% usr 0% sys 0% nic 0% idle 0% io 0% irq 99% sirq
Load average: 0.55 0.19 0.11 2/39 8922
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
7 2 root RW 0 0% 98% [ksoftirqd/0]
I had to install some modules to get IPv6 exposed in Luci, and more to get it to work, but I don't remember exactly which ones they were. Here's what 6rd settings look like:
Here are my IPv6 DHCP settings for the LAN interface:
I added static leases for computers on my network. I can't get the IPv6 suffix option on the static lease to work, but the IPv6 suffixes seem to be stable anyway.
For IPv4, I forward external port 23 to port 22 of an internal computer, and port 24 to port 22 of an internal computer. I wanted to do the same port translation for IPv6. IPv6 is different because those internal computers have unique IPv6 addresses, which are directly accessible (not NAT'd) externally. So usually port translations are not done for IPv6. However, I found out that by installing kmod-nf-nat6 and kmod-ipt-nat6, I could do the port translation for IPv6 with iptables too.
I only want the 23 to 22 forwarding for one computer on my network. I don't want to open up port 22 to all IPv6 computers behind the router. This is tricky because the specific IPv6 address I want to allow changes as my ISP changes the IPv6 address prefix through DHCP. Fortunately I found out that I can use an IPv6 netmask that matches just on the suffix. So -d ::f0a/::ffff:ffff:ffff:ffff
matches any IPv6 address that ends with 0:0:0:f0a
.
I also open a few ports for some minecraft servers to just one physical machine behind my router.
Here are the ip6table rules I have:
ip6tables -t nat -A PREROUTING -i 6rd-wan6 -p tcp -m tcp --dport 23 -d ::f0a/::ffff:ffff:ffff:ffff -m comment --comment "!fw3: ssh to ryoko" -j DNAT --to-destination :22
ip6tables -t nat -A PREROUTING -i 6rd-wan6 -p tcp -m tcp --dport 24 -d ::527/::ffff:ffff:ffff:ffff -m comment --comment "!fw3: ssh to mihoshi" -j DNAT --to-destination :22
ip6tables -A zone_wan_forward -p tcp -m multiport --dports 25565,25567,25568,3000 -d ::527/::ffff:ffff:ffff:ffff -m comment --comment "!fw3: minecraft ports for mihoshi" -j ACCEPT
ip6tables -A zone_wan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
I put them in Firewall - Custom rules.
I'm also using dynu for dynamic DNS. The IPv4 dynamic DNS is straight forward, but the IPv6 is tricky, because I don't want the router to use its IPv6 address, I want it to upload the address of mihoshi, one of the computers behind the router.
Here's my IPv6 DDNS configuration in the GUI:
It calls a script I wrote to look up the IPv6 address of mihoshi. It does the lookup using nslookup, which polls the database updated by the dhcp server (odhcpd).
root@OpenWrt:~# cat /etc/mihoshi-ipv6.sh
#!/bin/sh
address=`nslookup -q=AAAA mihoshi | sed -n -e 's/.*has.*address \(.*\)/\1/p'`
if [ -z "$address" ]; then
exit 1
else
echo "$address"
fi
root@OpenWrt:~# /etc/mihoshi-ipv6.sh
2602:ae:1543:b900::527