IP tunnel--Realize Ali intranet server can access the extranet ~

Source: Internet
Author: User

There are two of Ali's services, one A has assigned an extranet IP, and the other B does not, how to let B with a to achieve the Internet?

Handled as follows

On Server A

IP tunnel Add i2o mode IPIP remote B local A---here A, B are intranet addresses

Ifconfig i2o 192.168.2.1 netmask 255.255.255.0

On the B server

IP tunnel Add i2o mode Ipip remote a local B---here both A and B are intranet addresses

Ifconfig i2o 192.168.2.2 netmask 255.255.255.0


This completes the IP tunneling between the two servers as well as the virtual NIC i2o creation and IP assignment.


b Settings-Add route forwarding to a service

Route add-net 192.168.1.0/24 GW 192.168.2.1


A setting-a that has an extranet service forwards the request of a private ip192

Iptables-t nat-a postrouting-s 192.168.2.2-d 192.168.1.0/24-j Masquerade

Sed-i '/net.ipv4.ip_forward/s/0/1/'/etc/sysctl.conf

Sysctl-p


Under normal circumstances, you can implement B to access the external network ...


IP tunnel--Realize Ali intranet server can access the extranet ~

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.