Home Forums Getting Started Setting up ethernet switch

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41859
    Robb_Fr
    Participant

    Hello,

    I cannot find any documentation about how to set up, in ExpressoBin-ultra device, the ethernet switch mode managed by Topaz Switch.
    I would like to find a way to make my ExpressoBin use the switch forwarding without the use of CPU.

    Thanks a lot !

    #50302
    Peinepple
    Participant

    Are there any updates on this?

    #50303
    Robb_Fr
    Participant

    Hello,
    Bascially, the /etc/network/interfaces file you have on default boot correctly implements this.
    Here’s the correct bridge br0 configuration:

    auto br0
    iface br0 inet static
    address 192.168.84.1 #static address and netmask assignment
    netmask 255.255.255.0
    bridge_stp off #disables spanning-tree protocol features
    bridge_fd 0 #forwarding begins as soon as interface is up
    bridge_ports lan0 lan1 lan2 lan3 #lan ports are bridged together
    #dnsmasq is a dns and dhcp server that listens on br0 interface and will give IP addresses from specified range to the systems in LAN
    post-up dnsmasq –interface=br0 –except-interface=lo –bind-interfaces — dhcp-range=192.168.84.100,192.168.84.200,12h
    #enables routing (communication between lan interfaces and wan through br0)
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    #performs Network Address Translation (NAT) between WAN and LAN
    post-up iptables -t nat -A POSTROUTING -s ’192.168.84.0/24’ -o wan -j MASQUERADE
    #disables routing, NAT and dhcp server if bridge is set down
    post-down iptables -t nat -D POSTROUTING -s ’192.168.84.0/24’ -o wan -j MASQUERADE
    post-down echo 0 > /proc/sys/net/ipv4/ip_forward post-down pkill dnsmasq

    With this, the Topaz switch is used for forwarding (can be verified by listening to the eth0 interface with tcpdump for example. No packet should be visible as not treated by the OS). Other interfaces can be auto configured:

    auto eth0
    iface eth0 inet manual
    up /sbin/ifconfig $IFACE 0.0.0.0 promisc up
    down /sbin/ifconfig $IFACE down

    auto lan0
    iface lan0 inet manual

    auto lan1
    iface lan1 inet manual

    auto lan2
    iface lan2 inet manual

    auto lan3
    iface lan3 inet manual

    Hope this helps.

    #50386
    pali
    Participant

    Kernel driver for Topaz Switch uses DSA (Distributed Switch Architecture) API which automatically enable hardware forwarding between witch ports when network interfaces of switch ports are put into kernel bridge. It means that if you use standard linux tools for bridges (e.g. brctl, ip or bridge) and put lan0, lan1, etc. into br0 then kernel transparently enables hardware forwarding between lan0 and lan1 ports without using CPU.

    So basically you do not need to do anything, hardware switching is enabled transparently.

    As @robb_fr wrote, you can verify it via tcpdump on eth0 (this will show only packets which are going to CPU).

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Signup to our newsletter

Technical specification tables can not be displayed on mobile. Please view on desktop