OpenWRT (ii) configuring WAN ports and LAN ports

Source: Internet
Author: User
first, the basic concept

Lan:local Area Network's abbreviation, i.e. LAN
our computers and our routes are connected to this port .

Wan:wide Area network abbreviation, the WAN
the network cable that the operator pulls in is connected to the mouth.

The Chinese name of the VLAN (virtual local area network) is
VLANs are typically subdivided into several network segments logically in a local area network to form a VLAN. A local area network can be divided into more than n VLANs, so that VLANs cannot communicate with each other (usually for security reasons). Lan and WAN belong to VLAN II, configure WAN ports and LAN ports

First, download the OPENWRT system to the Development Board (RT5350), then power the board into the OPENWRT system and use the SECURECRT for command operation. (SecureCRT for people who are familiar with Linux embedded development.)

Configuration files in OpenWrt under/etc/config/, WAN and LAN configuration in/etc/config/network

Above is the screenshot after opening the file

Analyze the information in the above file (focus only):
Config interface ' LAN '//Configure LAN Port
Option type ' bridge '//bridging mode
OPTION ifname ' eth0.1 '//Represents vlan1, this is important, the following configuration will be used
Option proto ' static '//static IP

Config device ' Lan_dev '//Configure LAN hardware information
Option MACADDR//Set MAC address

Config interface ' WAN '//Configure WAN Port
Option type ' DHCP '//dhcp mode (DHCP self-Baidu)

Config switch//switch Chinese meaning on the switch, so the following is the Enable VLAN port
Option Enable_vlan ' 1 '//1 indicates the VLAN port is turned on

Config Switch_vlan
Option VLAN ' 1 '//vlan1, and the above option ifname ' eth0.1 ' match, so is configured LAN port
Option Ports ' 0 1 2 3 6t '//0~3 is LAN port, RT5350 has 5 ports

Config Switch_vlan
Option VLAN ' 2 '//vlan2, and the above option ifname ' eth0.2 ' matches, so is configured WAN port
Option ports ' 4 6t '//4 is a WAN port

Well, the above introduction should be able to configure the port as a LAN port or WAN port freely

The network file above is the UCI configuration file, so you can go deep into https://wiki.openwrt.org/doc/uci

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.