Linux dual NIC configuration Lab router

Source: Internet
Author: User

The lab's mainframe has finally windows2003 upgraded to ubuntu14.04. As for why the use of Tp-link routers, such as the processing power of the PC is higher than the processing power of tp-link, more reason is to want to customize a router, more flexible, such as configuration port mapping and so on.

1. Configure a router with dual NICs

(1) Dial-eth0

You can use a dial-up script, but now that the Linux comes with a dialer that already supports 802.1x, unlike Windows, which requires additional dialer, the 127 lab login password is: 00127125; Linux host username: 108lab, Both the password and root user password are 123

(2) Configure LAN network card information--eth1

Just started to use ifconfig dead and alive no eth1 information, and then run to the official website download driver, the result driver support to 2.6.11 kernel,,, finally reboot under the good ...

Use the command line ifconfig eth1 192.168.1.2 netmask 255.255.255.0 to configure the network card, without configuring the gateway.

(3) Open Ip_forward, transparent forwarding

Echo 1 >/proc/sys/net/ipv4/ip_forward
Then use the command to have the kernel take effect immediately:

Sysctl-p
In order to turn on the Ip_forward, in/etc/sysctl.conf find ip_forward that line, uncomment can be.

(4) Set NAT, the source IP of the packet that the LAN goes out to be converted to the router's external network IP

Iptables-t nat-a postrouting-o eth0-s 192.168.1.0/24-j Masquerade

(5) Add the above script to the startup script, so that the Internet can be switched on

Ifconfig eth1 192.168.1.2 netmask 255.255.255.0iptables-t nat-a postrouing-o eth0-s 192.168.1.0/24-j Masquerade





Linux dual NIC configuration Lab router

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.