DHCP Server on Ethernet port

I have a unique need. I'm not having much stability with wireless and have decided to go Ethernet. I'm trying to attach an Android device. Unfortunately, Android does not allow you to set a static IP address on the USB OTG Ethernet adapters, so I MUST use DHCP. This setup is in my car, so I wish to only use the Yun, and no other routers or devices. I've tried and tried to no avail to setup DHCP server, but can only ever get it working over wifi, not on Ethernet.

Is this an inherent flaw in the UI? It says I can have a DHCP server on the interface and it's not disabled. Same exact zone and settings as the wifi is, but only the wifi dishes it out. I tried disabling DHCP server for wifi so it would only be on Ethernet, but that too didn't work. Now I fear I've messed something up, and cannot access the Yun from either Wifi nor Ethernet. Wifi still dishes out DHCP, but I can no longer ping/ssh/or open http to it. the arduino.local also resolves, but does not respond. I've attempted resetting with the wifi button by holding for 20 seconds, but this too doesn't work. I don't want to factory reset my Yun because I have quite a bit configured on it.

When I remove the SD card and place it into my laptop, I don't have access to /etc so I assume that its all in the bootable .bin file. Is there a way to access this from my PC and fix the network config?

supersleeper:
I have a unique need. I'm not having much stability with wireless and have decided to go Ethernet. I'm trying ::::SNIP::::
When I remove the SD card and place it into my laptop, I don't have access to /etc so I assume that its all in the bootable .bin file. Is there a way to access this from my PC and fix the network config?

@supersleeper,
your not lost, just off course. :wink: We can do any of the things you need; starting by picking one of these off the list.

  • stabilize wifi and make it more reliable
  • make dhcp work on the ethernet
  • back up the configuration of your system to do a factory restart
    On #1, wifi instability is usually one of two issues (1) a factory defective unit (2) multiple interference points in the environment. Sometime, this is not a easy problem to solve.

On #2, when using the ethernet, the dhcp setting on the Yun is set to GET it's IP from an external route, NOT hand out IPs. This requires find the recipe at OpenWrt. (Or possibly SonnyYu has the settings, he will be on later today).

On #3, the file system on the Yun is not standard. If you are using the SD, the you are using an "overlay" file system. On this system, the base of the file sits on a ROM file system (on the firmware), and differences are stored on your SD. It's easier to do a tarball, rsync or cpio (if you are familiar with this).

There are likely more choice, perhaps ShapeShifter or someone else has an idea on this.

Jesse

  1. make dhcp work on the ethernet

http://forum.arduino.cc/index.php?topic=319496.msg2276731#msg2276731

  1. back up the configuration of your system to do a factory restart

Recover Yun OS by mount Micro SD on Linux box

http://forum.arduino.cc/index.php?topic=319716.0

jessemonroy650:
#1, wifi instability is usually one of two issues (1) a factory defective unit (2) multiple interference points in the environment. Sometime, this is not a easy problem to solve.

Thanks Jesse, this isn't a Yun specific problem. Something is up with my area in my home that disrupts the signal, and I can't seem to find the culprit. It's not the microwave. I have tried 5 different vendor access points with multiple different machines connected. It's always the auth that gets broken, but if I configure as open access point, I never have the issue. Of course, this is dangerous.

First, I guess I have to figure out how to un-brick my Yun. It is still dishing out DHCP via wifi, but I cannot ping the Yun at all. So effectively (I'm a network engineer BTW) layer 2 communication is working (DHCP functions on L2), but Layer 3 is not.

sonnyyu:
2. make dhcp work on the ethernet

Network and Yun - #19 by sonnyyu - Arduino Yún - Arduino Forum

THANK YOU SonnyYu, this is GOLD. Once I find out how to unbrick my Yun, I'll give this a shot. I suppose if I can't unbrick it, I'll just get the Yun shield and put it on my Leanordo, and start from scratch.

Argh, still can't get it to respond to an IP. I feel this little board has seen it's last days.

supersleeper:
::::SNIP::::

First, I guess I have to figure out how to un-brick my Yun. It is still dishing out DHCP via wifi, but I cannot ping the Yun at all. So effectively (I'm a network engineer BTW) layer 2 communication is working (DHCP functions on L2), but Layer 3 is not.

@supersleeper,
AHHH. You are a network engineer. Okay. No more baby talk. Wifi has lots of problems, but you'll need to walk through the steps.

  1. If you have a smart phone, get a wifi network analyzer. On my Android, I use wifi analyzer by far proc.
  2. download and load this sketch from github ArduinoYun-Wifi-Info
  3. Check for metal in your building. You need to have the Yun at least 24 inches from the nearest aluminium pole.
  4. If you connect the Yun to your laptop, keep it some distance. Sometimes the two radio signal overlap and interfere with each other. In a few instances, the Yun radio will shutdown.
  5. try some of SonnyYu's fixes. He has very good work arounds.

Jesse

jessemonroy650:

  1. If you have a smart phone, get a wifi network analyzer. On my Android, I use wifi analyzer by far proc.
  2. download and load this sketch from github ArduinoYun-Wifi-Info

Thanks Jesse, I'll give this a try. I've been looking for a decent wifi anylizer. Had a Fluke at my last job, but the Fluke here only does wired. I'm running over 25 nodes in my home alone, so it's a chore narrowing it down ;). Not to include any random device that could be emitting 2.4ghz signal. My entire family is complaining about it, including myself. I wish any of the 802.11 encryption standards were smart enough to attempt re-auth if it can't access it's gateway device.

1.stabilize wifi and make it more reliable

The wifi problem, at most case come from signal strength and overcrowding frequency spectrum (Signal-to-noise ratio).

Use second generation Yun shield which has better RF design or Dragino Yun shield which support external antenna directly to void wifi problem.

Hi Folks,

I was thinking how I can un-brick my Yun, and forgot I had created a cron job to execute command.sh file every 15 min! So, all I need to do is to shut down the Yun and edit the command.sh file and re-create the IP details on the wifi interface from shell, and I should be able to re-attach. Any idea what the command structure would be? Not sure if it uses standard OpenWRT config files or if it references something else.

Looks like I can do this, but I can't recall if I need sudo or not:

sudo ifconfig eth0 192.168.240.1 netmask 255.255.255.0 up

sudo service network restart

Was it eth0 that was wifi adapter or was that eth1?

No sudo on the Yun, you are always running with root super user privileges.

eth1 is the ethernet port, wlan0 is the WiFi. (At least on my Yun, not sure why there isn't an eth0?)

Great news! Yun is officially un-bricked. I'll try to set the dhcp server now for the Ethernet port and see if I can't get android an IP.

supersleeper:
THANK YOU SonnyYu, this is GOLD. Once I find out how to unbrick my Yun, I'll give this a shot. I suppose if I can't unbrick it, I'll just get the Yun shield and put it on my Leanordo, and start from scratch.

SonnyYu, need some more assistance with this config. I followed the directions with a couple spelling corrections. Still no DHCP from Ethernet. Here's my results:

root@330ci:/mnt/sda1/arduino# uci show dhcp
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.@dnsmasq[0].nonwildcard=1
dhcp.@dnsmasq[0].interface=lo
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.ignore=1
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.start=100
dhcp.wan.limit=150
dhcp.wan.leasetime=12h
dhcp.wan.ignore=0

and interface settings:

root@330ci:/mnt/sda1/arduino# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan._orig_ifname=wlan0
network.lan._orig_bridge=false
network.lan.proto=static
network.lan.ipaddr=192.168.1.10
network.lan.netmask=255.255.255.0
network.lan.gateway=192.168.1.1
network.lan.broadcast=192.168.1.255
network.lan.dns=4.2.2.2
network.wan=interface
network.wan.ifname=eth1
network.wan.metric=10
network.wan.proto=static
network.wan.ipaddr=192.168.241.1
network.wan.netmask=255.255.255.0
network.wan.broadcast=192.168.241.255

already tried reboot, and ifconfig reflects correct IP as above.

Plan B: disable dhcp function from dnsmasq, install standard dhcp server

http://forum.arduino.cc/index.php?topic=319496.msg2276731#msg2276731

finished step 1,2.

/etc/init.d/firewall disable
reboot
nano /mnt/sda1/setwandhcp.sh
#!/bin/ash
uci set network.wan.proto=static
uci set network.wan.ipaddr=192.168.241.1
uci set network.wan.netmask=255.255.255.0
uci commit network
uci set dhcp.wan.ignore=1
uci commit dhcp
/etc/init.d/dnsmasq restart
/etc/init.d/network restart
chmod 755 /mnt/sda1/setwandhcp.sh
/mnt/sda1/setwandhcp.sh
opkg update
opkg install isc-dhcp-server-ipv4
nano /etc/dhcpd.conf
# dhcpd.conf

authoritative;

default-lease-time 3600;
max-lease-time 86400;

option domain-name-servers 192.168.241.1;

subnet 192.168.241.0 netmask 255.255.255.0 {
  range 192.168.241.10 192.168.241.50;
  option routers 192.168.241.1;
}
/etc/init.d/dhcpd enable

/etc/init.d/dhcpd restart
  1. Testing:

Connect ethernet cable between Yun and PC, PC as DHCP client.

thanks Sonnyyu, I'll give this a shot.