Connect two CIDR blocks with Linux servers

Source: Internet
Author: User
Environment: two network segments, 192.168.1. * With 192.168.100. * The two vswitches cannot communicate with each other. 192.168.100. * There is a DNS on the network segment. One WEB server requires: 192.168.1. * access 192.168.100. * WEB server. implementation: Find a dual-nic Linux system. enable the routing function, # vietcsysctl. confnet. ipv4.ip_for

Environment: Two CIDR blocks, 192.168.1. * And 192.168.100. * cannot communicate with each other.

192.168.100. * There is a DNS server on the network segment.

Requirement: 192.168.1. * You can access the WEB server of 192.168.100.

Implementation:

Find a dual-nic Linux system. Enable the routing function,

  1. # Vi/etc/sysctl. conf
  2. Net. ipv4.ip _ forward = 1
  3. # Sysctl-p
 
  1. Eth0: 192.168.100.253
  2. Eth1: 192.168.1.253

Client 192.168.1. * Configuration:

Add a route entry:

  1. RouteDd-P 192.168.100.0 mask 255.255.255.0 192.168.1.253
Configure DNS to 192.168.100.

192.168.100. * WEB server configuration on the network segment:

  1. Route add-net 192.168.1.0 gw 192.168.100.253 netmask 255.255.255.0
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.