Page 1 of 1

[HOWTO] Bridging on QNAP TS-412

Posted: Mon Jun 13, 2011 5:55 am
by Lorenz0
Hi everyone,

I’d like to share with you my bridging setup. All credit goes to the guy who write this: Probably the following will work also on other ARM based QNAPs, but I don’t want to generalize unduly my personal experience. If it worked for you, please post your experiences below…

So why would you want to bridge your two interfaces?

  • You’re a cheap b*stard or for some other reason you don’t want to buy a gigabit switch (e.g. “I just need one more port!”)
  • Compared with routing (ip_forwarding) you don’t have to alter your routing table or — worse — run a routing protocol, and the Bonjour/Zeroconf/SSDP magic will continue to work
  • You want to try out all Linux Kernel features before you die :mrgreen:

And why wouldn’t you want to?
  • You love the comfort of being able to complain if something doesn’t work afterwards — needless to say, but all of this is rigorously unsupported by QNAP!
  • You’re not at ease on the Linux command line
  • Your current setup just works — remember: if it ain’t broken don’t fix it.

Yada, Yada, let’s begin!
  • Install Optware IPKG
  • The bridging functionality is contained in two loadable modules in /usr/local/modules, but we need the bridge-utils package to configure it:

Code: Select all

/opt/bin/ipkg install bridge-utils

  • Put the following script anywhere you like — do not put it yet in /opt/etc/init.d/! I suggest to first modify it and give it a dry run… ( start) That way, if it locks you out you can just reboot the device and your former network settings will be restored. When you are confident that it does its job (do all services work?), put it in /opt/etc/init.d/S05bridge, (don’t forget to chmod +x it!) so that it will be executed after the standard /etc/rcS.d scripts, but before any ipkg services (e.g. named).

Code: Select all

# Setup bridging
SERVICES=" " #Modify this list to suit your needs…

case "$1" in
    /bin/echo -n "Stopping network services.... "
    for i in $SERVICES
      if [ -f /etc/init.d/$i ]; then
        echo -n "$i "
        /etc/init.d/$i stop 1>>/dev/null 2>>/dev/null
    sleep 1
    /bin/echo "Initializing Bridge"
          insmod /usr/local/modules/stp.ko
          insmod /usr/local/modules/bridge.ko
          ifconfig eth0
          ifconfig eth1
          /opt/sbin/brctl addbr br0
          /opt/sbin/brctl addif br0 eth0 eth1
          ifconfig br0 netmask # Modify this!
          route add default gw
    /bin/echo -n "Restarting network services... "
    for i in $SERVICES
      if [ -f /etc/init.d/$i ]; then
        echo -n "$i "
        /etc/init.d/$i start 1>>/dev/null 2>>/dev/null


You’ll have to adapt the services list to your needs, maybe ps will be useful.

Additional remarks regarding services:
  • Obviously you don’t need to do anything for sevices that launch after this script gets executed
  • Philippe (father_mande) informs me below (thanks!) that some (most?) services don’t need to be relaunched iff the new bridge interface has an IP formerly assigned to one of the now bridged interfaces.
    These are (incomplete list):
    • ssh
    • Qthttpd
    • samba
    • ...
  • Some other services use a different way to send packets and won’t simply change over to our new br0 interface. They need to be restarted in any case. These are (incomplete list):
    • dhcpd (Qnap used as dhcp server)
    • atalk (needed for AFP)
    • twonkymedia server (third party UPNP server)
    • upnpd (QNAPs UPNP server)
    • ...
  • Other services have more serious issues and tend to jump off the bridge instead of crossing it! ok, that was lame…
    These are (incomplete list):
    • Vlan
    • MyCloudNas
    • ...
ifconfig output after successful bridging:

Code: Select all

br0       Link encap:Ethernet  HWaddr 00:08:9B:12:34:56  
          inet addr:  Bcast:  Mask:
          RX packets:24461929 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6977196 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3832271112 (3.5 GiB)  TX bytes:652711934 (622.4 MiB)

eth0      Link encap:Ethernet  HWaddr 00:08:9B:12:34:56 
          RX packets:11893452 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15910936 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:532
          RX bytes:871388924 (831.0 MiB)  TX bytes:1173610636 (1.0 GiB)

eth1      Link encap:Ethernet  HWaddr 00:08:9B:12:34:57
          RX packets:14415456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11943097 errors:0 dropped:15 overruns:0 carrier:0
          collisions:0 txqueuelen:532
          RX bytes:4098383521 (3.8 GiB)  TX bytes:1534105799 (1.4 GiB)

lo        Link encap:Local Loopback 
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:68661 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68661 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4484202 (4.2 MiB)  TX bytes:4484202 (4.2 MiB)

Please report you findings below!

Re: [HOWTO] Bridging on QNAP TS-412

Posted: Tue Jun 14, 2011 11:25 pm
by Lorenz0
Salut Philippe,

thanks for your suggestions, I will revise the first post!

Regarding the QPKG: unfortunately I am in midst of an exam period, maybe I will look into this in three weeks or so, sorry…!
Also I don’t have any experience regarding QPKGs, can you point me to some useful references?

Best wishes,