Debian NAT configuration

Source: Internet
Author: User
Debian NAT configuration-Linux Release Technology-Debian information. For details, refer to the following section. My configuration content:
1. The first step is the PPPoE configuration. This is very simple. Run the pppoeconf command and follow the wizard step by step. After the configuration is complete, start the PPPoE command: pon dsl-provider (sometimes it is okay to directly enter pon ). Command to disconnect PPPoE: poff (or poff-).

2. Create/etc/init. d/nat. sh as follows:
#! /Bin/sh
Echo "Starting PPPoE ..."
/Usr/bin/pon dsl-provider
Echo "Enabling IP Forwarding ..."
Echo 1>/proc/sys/net/ipv4/ip_forward
Echo "Starting iptables rules ..."
# Refresh all chains
/Sbin/iptables-F-t nat
# Only trans package
# Note that the-s parameter in the following line needs to be modified according to your network conditions
/Sbin/iptables-t nat-a postrouting-s 192.168.0.0/24-o ppp0-j MASQUERADE

3. # chmod 755/etc/init. d/nat. sh

4. If you want to enable NAT automatically at startup, edit/etc/init. d/rcS and add the following content at the end of the file:
/Bin/sh/etc/init. d/nat. sh

Note: The above content is mainly copied from the dual debian installation note.

5. If you want to manually start NAT, run:
#/Bin/sh/etc/init. d/nat. sh

6. In fact, the machine sets the gateway to the eth0 IP address of Debian, and then sets the correct DNS server.

7. Get it done!
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.