No public network IP access to the public network through a springboard machine scheme

Source: Internet
Author: User

Springboard: Pre-release: 10.124.156.244

Client: Android Packaging server: 10.124.156.247-250


Configuration:

Springboard machine:

1. Turn on the forwarding function:

#vi/etc/sysctl.conf

====================

Net.ipv4.ip_forward = 1

====================

#sysctl –p

2.iptables Turn on forwarding

(iptables-t nat-a postrouting-s 10.124.156.0/24-o eth0-j Masquerade)

#vim/etc/sysconfig/iptables

====================

-T nat-a postrouting-s 10.124.156.0/24-o Eth0-j Masquerade

====================

and comment on the rule:-A forward-j REJECT--reject-with icmp-host-prohibited (closes the packet suppression rule on the FORWARD table)

#service iptables restart Restart iptables service


Client: Linux Side

Edit the NIC profile to point to the default gateway for the server 10.124.156.1 10.124.156.244

#vim/etc/sysconfig/network-scripts/ifcfg-eth0

===================

Device=eth0

Bootproto=static

gateway=10.124.156.244

Hwaddr=28:6e:d4:89:c2:36

Ipaddr=10.124.156.xxx

netmask=255.255.255.0

Onboot=yes

Type=ethernet

Userctl=no

Ipv6init=no

Peerdns=yes

==================

#service Network Reload restart the NIC service


Client: Mac Side

System Preferences >> Network configuration >> Modify the IP address routed to the proxy server 10.124.156.244>> app

Note: If the rule that requires comments in iptables is not commented, there will be a cross-network segment access to different issues

Test:

Ping www.baidu.com can be configured properly by pinging!


Note: This scenario is successfully tested on Huawei Cloud platform. (when configured in a physical machine cluster, it is only necessary to add a route to the springboard on the client)


This article is from "Dolphin Watching" blog, please be sure to keep this source http://swht1278.blog.51cto.com/7138082/1693452

No public network IP access to the public network through a springboard machine scheme

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.