Enable kernel forwarding (NAT) in Linux)

Source: Internet
Author: User
In fact, most Linux VPN modules (ppp) basically adopt route forwarding. If you want to use Linux to implement the most basic routing (switch) function, you must enable the kernel forwarding service. 1. enable the Linux kernel to forward echo & quot; 1 & quot; & gt;/proc/sys/net/ipv4/ip_forwardSSH and run the preceding commands. if the value is 1, enable the command, and if the value is 0, disable the command.

 

In fact, most Linux VPN modules (ppp) basically adopt route forwarding. If you want to use Linux to implement the most basic routing (switch) function, you must enable the kernel forwarding service.

1. enable Linux kernel forwarding


echo "1" > /proc/sys/net/ipv4/ip_forward

Run the preceding commands in SSH. 1 is enabled, and 0 is disabled.

2. enable automatic startup


vi  /etc/sysctl.conf

Modify the following characters


# Controls IP packet forwardingnet. ipv4.ip _ forward = 0 #0 is disabled, 1 is enabled

Save the modification and load it automatically after the next boot.

You can use iptables or ppp to implement NAT. For more information, see the following tutorial.

Related Article

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.