Sharing the wireless connection of a laptop with the ZedBoard through an Ethernet cable
The following assumes that the laptop runs Debian jessie but things should be very similar with most Debian-like GNU/Linux distributions. If you are using a completely different OS, please find out the equivalent steps for your OS. We also assume that:
the laptop network interfaces are wlan0 (wireless) and eth0 (wired),
the laptop's IP address in the wired network is 10.42.0.103,
the ZedBoard runs a Linux kernel and has networking enabled,
the ZedBoard's Ethernet and IP addresses are 00:0A:35:00:01:06 and 10.42.0.6, respectively,
and the ZedBoard's host name must be secbus.
Please adapt to your own setting.
First install the dnsmasq and iptables-persistent packages:
sudo apt-get install dnsmasq iptables-persistent
dnsmasq provides a local DNS server for the laptop and its wired network, with forwarding of all query types to upstream recursive DNS servers. It also does DNS caching and has an integrated DHCP server. Edit the /etc/dnsmasq.conf file (search for the indicated commented lines and add yours below):
Restrict the dnsmasq services to the eth0 interface of the laptop (for security reasons):
Enable the DHCP server and define the IP address available for lease (with infinite lease time):
Make this permanent (thanks to iptables-persistent):
iptables-save | sudo tee /etc/iptables/rules.v4
Tell the kernel to enable the IP forwarding:
sudo sysctl -w net.ipv4.ip_forward=1
Make this permanent by editing /etc/sysctl.conf and un-commenting the line:
Use the NetworkManager to create your wireless network connection. Check the "Automatically connect to this network when it is available" box in the "General" tab. Check that the connection works.
Use the NetworkManager to create your wired network connection. Un-check the "Automatically connect to this network when it is available" box in the "General" tab to avoid it to be started first and to take precedence over the wireless one. Open the "IPv4 Settings" tab, select the "Manual" method and add the 10.42.0.103 static IP address with 255.255.255.0 netmask. You can leave the "Gateway" field empty.
Connect the ZedBoard to the laptop with an Ethernet cable (crossover cables are not needed because the ZedBoard is gigabit Ethernet capable). The wired network connection should show up on the laptop. Verify that the wireless connection is active and enable the wired network connection. On the ZedBoard check your network interfaces:
If lo (loopback) is the only listed interface, try to start eth0 manually: