Ubuntu Set IP Forwarding

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.