For the needs: embedded development, often use the board and the notebook directly, so that the board can not connect to the external network. Of course, the board can be connected to the LAN, our notebook through the router to connect to the board, to do so, must do a lot of modification of IP operations. So, you can configure the notebook forwarding, so that the board can be used in the laptop network.
Development Board Modification:
1. Modify the Development Board/etc/network/interface file, mainly to change the gateway to notebook IP.
2. Reseat the network cable for the configuration to take effect. (Can ifdown after ifup, Plug and unplug the network cable faster:)
Notebook (Ubuntu, requires native root privileges):
1. Enable native Ip_forward: echo 1 >/proc/sys/net/ipv4/ip_forward
2. Set the iptables rule:
Clear all Rules: iptables-f
Because everything is clear, input must be allowed first: iptables-p input ACCEPT
Also need to allow fordward:iptables-p FORWARD ACCEPT
Allow NAT to forward all packets to wlan0:iptables-t nat-a postrouting-o Wlan0-j Masquerade
You can use the following two instructions to see if the configuration is valid:
1. If the Ip_forward is open, the output 1:cat /proc/sys/net/ipv4/ip_forward
2. iptables-l see what the rules are
Ubuntu Set IP Forwarding