Linux-based layer-3 switches

Source: Internet
Author: User
Article title: a three-tier switch based on the Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

First of all, install a basic LINUX operating system, I use Debian testing version, from: http://www.kernel.org/download kernel source code, if you can now access the Internet can be directly executed: aptitude install kernel-source-2.6.8 (testing is the 2.6 kernel), copy the file: kernel-source-2.6.8.tar.bz2 to the:/usr/src Directory, run: tar jvxf kernel-source-2.6.8.tar.bz2 to get the new directory: kernel-source-2.6.8, and enter the directory kernel-source-2.6.8.

Before compiling the kernel, remember to set kernel-package ncurses-dev fakeroot wget bzip2 makepatch properly. Otherwise, the compilation will fail and an error will be reported, then, compile the kernel to add 802.11Q. Debian:/usr/src/kernel-source-2.6.8 # make menuconfig select all options in Device Drivers à Networking support à Networking options: TCP/IP networking, IP: multicasting, IP: advanced router, IP: policy routing, IP: use netfilter MARK value as routing key, IP: fast network address translation, IP: multicast routing, Network packet filtering, 802.1d Ethernet Bridging, 802.1Q VLAN Support, Forwarding between high speed interface S must be added to the kernel (SELECT *). In addition, remember to add the EXT2 and EXT3 File formats in File systems to the kernel. otherwise, do not blame me if the system cannot be started. Finally, save the configuration result.

Run: make, make-kpkg clean, make-kpkg? Initrd? Append-to-version = oursoft? Revision = 1.0 kernel_image. Finally, an installation file: kernel-image-2.6.8oursoft_1.0_i386.deb will be generated under the/usr/src Directory, directly execute: dpkg? I kernel-image-2.6.8oursoft_1.0_i386.deb installation is enough. Restart the system to select a new kernel kernel-image-2.6.8oursoft.

Install the Linux-based VLAN Division tool: aptitude install vlan

Add the required VLAN (interface): vconfig add eth1 200.

Add the IP address ifconfig eth1.200 192.168.200.1 netmask 255.255.255.0 up for the VLAN (interface ).

Modify the MAC address of a VLAN (interface): ifdown eth1, ifconfig eth1.200 hw ether 00: 05: 5D: 61: 00: 31, ifup eth1

A complete VLAN (interface) is successfully added. This function is equivalent to executing vlan 200, ip address 192.168.200.1 255.255.0 on a layer-3 switch.

Configurations on L2 switches

The configuration on the L2 switch is the same as before. take AVAYA P334 as an example: set vlan 200, set port vlan 200 1/2, set trunk 1/1 dot1q, and set port vlan-binding-mode 1/1 bind-to-configured. the L2 configuration is complete, connect Port 1 of the vSwitch to eth1 of Linux, Port 2 to a client, and configure the IP address 192.168.200.X/24 of the client to 192.168.200.1 as the gateway, now you can ping 192.168.200.1 (Linux.

Other functions

After implementing the three-tier switch function in Linux, we can start more services on it, such as DHCP, DNS, NAT, Raduis, policy routing, and access control (ACL ), p2P restrictions.

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.