Linux dual-nic configuration lab router, linux lab

Source: Internet
Author: User

Linux dual-nic configuration lab router, linux lab

The lab host has finally been upgraded from windows2003 to ubuntu14.04. the reason for not using a vro such as TP-link is that the PC processing capability is higher than the processing capability provided by TP-link. More reason is that you want to customize a vro by yourself, more flexible, such as configuring port ing.

1. configure a vro with two NICs

(1) dialing-eth0

You can use a dial-up script, but now the dial in linux supports 802.1x. Unlike windows, you need to install an additional dial. the login password of the 127 lab is 00127125. the user name of the linux host: lab, password and root User Password Are 123, you can use the ssh lab@192.168.1.2 for remote control ~

(2) configure the LAN Nic information-eth1

At the beginning, I started to use ifconfig without the eth1 information. Then I ran to the official website to download the driver. The result driver supported the 2.6.11 kernel. Then I restarted it...

Use the command line ifconfig eth1 192.168.1.2 netmask 255.255.255.0 to configure the NIC. You do not need to configure the gateway.

(3) Enable ip_forward and transparent forwarding

echo 1 > /proc/sys/net/ipv4/ip_forward
Then run the command to make the kernel take effect immediately:

sysctl -p
In order to enable ip_forward upon startup, find the line ip_forward in/etc/sysctl. conf and uncomment it.

(4) set NAT to convert the source ip addresses of packets sent out from the LAN to the Internet ip addresses of the routers.

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 you can access the Internet at startup.

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 routing configuration

You can take a look at the use of ROS. It is very simple, but I haven't used this thing for a long time, and you have no points, or I can tell you.

Login: admin
Password:
...........
Setup
Enter
Enter1
Enter
Enter 192.168.0.20.
Enter
Input X
After exiting
System
Reboot
Y

ENTER1 refers to the first network card from top to bottom.
For some ROS versions, use telnet 192.168.0.20.to access

Linux dual-nic routing configuration problems

This is also the case after I set it, but it does not affect the use of TCP/IP programs.
One thing is different from yours: I am a network card and use it for two.
Herofit.blogspot.com/2006/10/linux.html

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.