FON as bridge (讓FON跑橋接模式)

  1. Login with a SSH client.
  2. Save the following (modified from this script) as /etc/init.d/N15bridge. Modify the “# Set IP for the bridge" section to meet your needs.
    echo “Setting up LAN bridge"# Kill DHCP server+ client
    /usr/bin/killall dnsmasq
    /usr/bin/killall -9 udhcpc

    # create bridge interface
    /usr/sbin/brctl addbr br0
    /usr/sbin/brctl stp br0 off
    /usr/sbin/brctl setfd br0 0

    # shutdown/remove IPs from the old interfaces
    /sbin/ifconfig eth0:1 down
    /sbin/ifconfig eth0
    /sbin/ifconfig ath1

    # bring up the bridge interface
    /sbin/ifconfig br0 up

    # add the old interfaces to the bridge
    /usr/sbin/brctl addif br0 ath1
    /usr/sbin/brctl addif br0 eth0

    # set IP of the bridge for FON remote admin
    /sbin/udhcpc -i br0 -R # get new IP via dhcp
    #/sbin/ifconfig br0 # remove the leading # to specify a static IP
    #/sbin/route add default gw # remove the leading # to specify the default gateway

    # set firewall rules
    iptables -I INPUT -i br0 -j ACCEPT
    iptables -I OUTPUT -o br0 -j ACCEPT

    # add bridge to hostapd.conf and restart hostapd (allows to use WPA)
    echo bridge=br0 >> /tmp/hostapd.conf
    /usr/bin/killall hostapd
    /usr/sbin/hostapd -B /tmp/hostapd.conf

    # restarting dnsmasq but without dhcp

  3. chmod +x /etc/init.d/N15bridge
  4. vi /sbin/ifup, replace “wan_ifname=${wan_ifname:-eth0}" with “wan_ifname=${wan_ifname:-br0}", save the file.
  5. Go to, log in and update shared bandwidth.
  6. reboot

If /sbin/ifup has been updated in future updates, you must modify it again after the update and reboot.

本篇發表於 電腦和網際網路。將永久鏈結加入書籤。


在下方填入你的資料或按右方圖示以社群網站登入: Logo

您的留言將使用 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s