Access Point/Router > wired connection configuration

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Access Point/Router > wired connection configuration

Postby megavolts » Tue Oct 18, 2016 5:11 pm

Hi All,
Thanks a lot to the ArchLinux ARM community. I've always being able to find good resources readily available on the forum. Yesterday, I ended up in an issue that I wasn't able to solved by myself and a bit of reading. First a brief description of my setup (or my attended setup), and then a few config that I am currently using and then, I will pass the keyboard to you, fellow users. Thanks a lot for this past year, and thanks in advance to help me on my case.

Leaving out of town in Alaska I do not have internet. My media/backup center [islay] is connected through the wired interface to my router (eth0). This media center isn't on all the time, and I am using often the function wake on lan to start it. I have 2 small weather stations outside of my house, that are connected to the wireless. They back up weather data when the Islay is online. I do use my phone/tablet to control the xbmc media center running on islay via the wireless network. I often upload/download new version of my thesis on islay via sftp. Sometimes I share the thered connection of my phone to my laptop through the whole network to update the media center

I am currently trying to replace my dying router by a small raspberry pi [RPi] which will act as (1) the old router and (2) run a small phant server to let me upload in continuous the data from my station and display a simple webpage with basic information about the sensor reading. The wireless interface (wlan0) of the RPi is set to a fix IP (192.168.1.1). I was able to configure the AP with hostapd/dnsmasq and connect to it with my phone/tablet. I was able to set up the phant server and connect my weather station to log data on it. I am able to ssh from the phone to RPi or laptop. Weather station are install on LinkIt Smart 7688 Duo which runs openwrt.


|------|<(eth0)===WIRED===(eth0)>Islay (always, wake on lan)
| . R . |<(wlan0)---WIRELESS---(wlp3s0)> laptop (sometimes)
| . P . |<(wlan0)---WIRELESS---(ra0)> weather station (always connected)
| . i . |<(wlan0)---WIRELESS---(?0)> tablet (sometimes
|------|<(usb0)---TETHERED---(?0)> phone (sometimes)

Here are my issue:
(1) I do have a problem to set up the wired network between Islay/Pi. Wether or not the eth0 IP address of the RPi is fix or not, wired interface of islay isn't able to get an IP address. I tried to set fixed IP on both device with identical submask, without success. For the various configuration I tried to add

$this->bbcode_second_pass_code('', 'interface=eth0')

in the dnsmasq config. Any help will be welcome. Below the configuration file I use for hostapd and dnsmasq.

hostapd.conf


$this->bbcode_second_pass_code('', 'ssid=RedTrim
interface=wlan0
hw_mode=g
channel=1
driver=nl80211
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1')

dnsmasq.conf
$this->bbcode_second_pass_code('', 'interface=wlan0
interface=eth0
bind-dynamic
dhcp-range=192.168.1.2,192.168.1.10,255.255.255.0,12h
domain-needed
server=8.8.8.8
bogus-priv')

I had this following line in the dhcpcd.conf

$this->bbcode_second_pass_code('', 'denyinterfaces wlan0')

Both hostapd and dnsmasq service once networking is up on wlan0:

$this->bbcode_second_pass_code('', 'BindsTo=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device ')

(1) I was successful in sharing the internet connection from my phone with the wireless network. Using

$this->bbcode_second_pass_code('', 'net.ipv4.ip_forward=1')

in sysctl and a NAT by setting the correct iptables rules:

$this->bbcode_second_pass_code('', 'iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -A FORWARD -i usb0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o usb0 -j ACCEPT')

Will it be as easy to share it with the wired connection using eth0 rather than wlan0 in the above line?

(2) Will someone explains to me the difference between bind-dynamic and bind-interfaces in dnsmasq. When using bind-interfaces the services failed to start during the startup when either one of the interface is not ready or not connected. But I am able to launch it manually when I am logged in the console.

Thanks for reading so far.
megavolts
 
Posts: 1
Joined: Tue Oct 18, 2016 4:53 pm

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 11 guests