Linux router configuration instance

Source: Internet
Author: User
Linux router configuration instance

Release date:2002-06-06
Abstract:

Author: Cold wind
Http://www.chinalinuxpub.com

Task: Use a Linux server to configure a router.

Objective: To achieve mutual access between two network segments: 192.168.1.0/24 and 192.168.2.0/24.

Steps:

1. Install a machine with dual NICs

2. Set eth0 address to 192.160.1.254 and eth1 address to 192.168.2.254:

# Ifconfig eth0 192.168.1.254 broadcast 192.168.1.255 netmask 255.255.255.0

# Ifconfig eth1 192.168.2.254 broadcast 192.168.2.255 netmask 255.255.255.0

3. Add route information:

# Route add-net 192.168.1.0 netmask 255.255.255.0 Dev eth0

# Route add-net 192.168.2.0 netmask 255.255.255.0 Dev eth1

4. Set the default gateway of all hosts in the 192.168.1.0/24 CIDR block to 192.168.1.254, and the default gateway of all hosts in the 192.168.2.0/24 CIDR block to 192.168.2.254.

5. Test

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.