[GUIDE] How to set Udoo Neo as a bridge

Discussion in 'UDOO NEO' started by Gorgo, Jun 26, 2017.

  1. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    I managed to set a udoo neo as a bridge.
    - I bought a Wifi dongle (https://www.amazon.it/DONGLE-FERGUS...ie=UTF8&qid=1498469964&sr=8-1&keywords=rt5370). It's a Ralink rt5370 antenna.

    - I installed firmware-ralink package, wpasupplicant and wireless-tools

    - Edit /etc/network/interfaces and add wlan0 and wlan1

    Code:
    # Loopback network interface
    auto lo
    iface lo inet loopback
    
    # Primary network interface
    #auto eth0
    #iface eth0 inet dhcp
    
    # USB OTG connection
    allow-hotplug usb0
    iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    
    auto wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant.conf
    
    # WiFi
    auto wlan1
    iface wlan1 inet static
    address 192.168.22.1
    netmask 255.255.255.0
    #hostapd /etc/hostapd/hostapd.conf
    - Edit /etc/default/hostapd

    Code:
    # Defaults for hostapd initscript
    #
    # See /usr/share/doc/hostapd/README.Debian for information about alternative
    # methods of managing hostapd.
    #
    # Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
    # file and hostapd will be started during system boot. An example configuration
    # file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
    #
    DAEMON_CONF="/etc/hostapd/hostapd.conf"
    
    # Additional daemon options to be appended to hostapd command:-
    #     -d   show more debug messages (-dd for even more)
    #     -K   include key data in debug messages
    #     -t   include timestamps in some debug messages
    #
    # Note that -B (daemon mode) and -P (pidfile) options are automatically
    # configured by the init.d script and must not be added to DAEMON_OPTS.
    #
    #DAEMON_OPTS=""
    
    - Edit /etc/hostapd/hostapd.conf

    Code:
    hw_mode=g
    channel=11
    driver=nl80211
    ssid=my-network-name
    interface=wlan1
    # possible MAC address restriction
    #macaddr_acl=0
    #accept_mac_file=/etc/hostapd.accept
    #deny_mac_file=/etc/hostapd.deny
    #ieee8021x=1    # Use 802.1X authentication
    # encryption
    wpa=2
    wpa_passphrase=my-secret-password
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP CCMP
    rsn_pairwise=CCMP
    ctrl_interface=/var/run/hostapd
    # Only root can configure hostapd
    ctrl_interface_group=0
    
    - Install dnsmasq ( apt-get install dnsmasq )

    - Edit /etc/dnsmasq.conf and add:
    Code:
    interface=wlan1
    dhcp-range=192.168.22.2,192.168.22.100,2h
    - Edit /etc/rc.local and add: (This step may not be necessary)
    Code:
    rfkill unblock wlan0 && hostapd /etc/hostapd/hostapd.conf
    - Remove network-manager (apt-get remove network-manager)

    - Edit /etc/default/isc-dhcp-server
    Code:
    # Defaults for isc-dhcp-server initscript
    # sourced by /etc/init.d/isc-dhcp-server
    # installed at /etc/default/isc-dhcp-server by the maintainer scripts
    
    #
    # This is a POSIX shell fragment
    #
    
    # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
    #DHCPD_CONF=/etc/dhcp/dhcpd.conf
    
    # Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
    #DHCPD_PID=/var/run/dhcpd.pid
    
    # Additional options to start dhcpd with.
    #    Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
    #OPTIONS=""
    
    # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
    #    Separate multiple interfaces with spaces, e.g. "eth0 eth1".
    INTERFACES="usb0"
    - Edit /etc/dhcp/dhcpd.conf
    Code:
    default-lease-time 86400;
    max-lease-time 8640000;
    log-facility local7;
    
    subnet 192.168.7.0 netmask 255.255.255.0 {
        option routers        192.168.7.2;
        option subnet-mask    255.255.255.0;
        range 192.168.7.1    192.168.7.100;
    }
    
    #subnet 192.168.100.0 netmask 255.255.255.0 {
    #    option routers        192.168.100.1;
    #    option subnet-mask    255.255.255.0;
    #    range 192.168.100.10    192.168.100.20;
    #}
    
    - Enable ip_forwarding with echo
    Code:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    or to make it permanent, edit /etc/sysctl.conf
    Code:
    net.ipv4.ip_forward=1
    
     
    waltervl likes this.
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Thanks for sharing!
     

Share This Page