How to add network segments to Linux Route-eth0

Source: Internet
Author: User



PC1 and PC2 for the same LAN

The IP of the PC1 network interface named Enp2s0,enp2s0 is 192.168.200.156

The IP of the PC2 network interface named Eth0,eth0 is 192.168.200.157


1) Add a virtual network interface on the PC1

VI ifcfg-enp2s0:0

The value of HWADDR is the hardware address of ENP2S0

ipaddr=192.168.100.100

netmask=255.255.255.0

Bootproto=none

Onboot=yes

Device= "enp2s0:0"


2) Cat/proc/sys/net/ipv4/ip_forward

1


3) Restart the PC1 network



PC2 above


4) VI Route-eth0

192.168.100.0/24 via 192.168.200.156 Dev eth0

Restarting the network will be OK.


This article is from the "12208412" blog, please be sure to keep this source http://12218412.blog.51cto.com/12208412/1875033

How to add network segments to Linux Route-eth0

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.