Find the answer to your Linux question:
Results 1 to 2 of 2
Ok I am new to this both forums and iptables etc. Background I have a Beaglebone running debian. On this device I am using eth0 (setup as a dhcp server ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    A_P
    A_P is offline
    Just Joined!
    Join Date
    Jul 2014
    Posts
    1

    Routing 2 subnets


    Ok I am new to this both forums and iptables etc.


    Background

    I have a Beaglebone running debian. On this device I am using eth0 (setup as a dhcp server - 192.168.2.0/24). I have a wlan0 set up as an access point (192.168.4.0/24). I am using HostAPD for the access point and dnsmasq as the dhcp server in both cases. The idea is that I provide an IP address to the device(s) on eth0 and then allow access to this device through the access point on wlan0. The DHCP server is working and providing IP addresses as required on eth0 and on the access point.

    Issue

    I need now to do the allowing of any device on the access point to talk to the device(s) on the eth0. This is proving most difficult and some input from someone with more knowledge than me.

    Detail

    /etc/network/interfaces

    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.2.1
    network 192.168.2.0
    netmask 255.255.255.0

    auto wlan0
    iface wlan0 inet static
    address 192.168.4.1
    network 192.168.4.0
    netmask 255.255.255.0
    broadcast 192.168.4.255


    /etc/dnsmasq.conf

    expand-hosts
    domain=test.com
    interface=eth0
    interface=wlan0

    dhcp-range=eth0,192.168.2.40,192.168.2.99,12h
    dhcp-option=1,255.255.255.0
    dhcp-option=eth0,3,192.168.2.100
    dhcp-option=eth0,6,192.168.2.100

    dhcp-range=wlan0,192.168.4.40,192.168.4.99,12h
    dhcp-option=wlan0,3,192.168.4.100
    dhcp-option=wlan0,6,192.168.4.100

    /etc/hostapd/hostapd.conf

    interface=wlan0
    driver=nl80211
    country_code=GB
    ssid=DASB
    channel=5
    hw_mode=g
    wpa=2
    wpa_passphrase=debianos
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP
    auth_algs=1
    macaddr_acl=0
    wme_enabled=0
    ignore_broadcast_ssid=0
    eap_reauth_period=3600
    ieee80211n=1


    Currently I have a Ubuntu PC connected to eth0, and a windows XP machine and my phone connected to my access point. I can ping from any device to the relevant 192.168.x.1

    I know I must set up ipforward = 1 but other than this tried a variety of iptables setups and nat etc but as i don't know enough about this part I thought I wouldn't mislead anyone.

    Hope someone can guide me

    A_P

  2. #2
    Just Joined!
    Join Date
    Sep 2014
    Location
    Seattle, WA
    Posts
    14
    Please post the output from the following commands:
    Code:
    /sbin/iptables -L
    ip addr
    ip route
    cat /proc/sys/net/ipv4/ip_forward

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •