Question: iptables filters the address of the mongodb link, iptablesmongodb

Source: Internet
Author: User

Question: iptables filters the address of the mongodb link, iptablesmongodb

HOST: aws ec2 linux

Service: mongodb

 

Iptables rules:

1. The host allows the specified pc to access port 27017.

Iptables-I INPUT-p tcp -- dport 51376-m mac -- mac-source xx: xx-j ACCEPT

2. The host allows access from the network segment 172.31.0.0/16 to 27017.

Iptables-I INPUT-s 172.31.0.0/16-p tcp -- dport 27017-j ACCEPT

3. The host rejects access from any address.

Iptables-a input-p tcp -- dport 27017-j DROP

 

Description:

Allow the specified pc connection to port 27017 to facilitate the programmer's link to the inverted library for debugging.

For the sake of database security and the communication between database cluster nodes, in addition to the local lan cidr block of 172.31.0.0/16, port 27017 is denied from any link to the address.

 

Problem:

The iptables configuration is correct. log on to the host with the specified mac address. Failed to send logon. The link is rejected.

After the mongodb host captures the packet, the mac address in the packet does not match the mac address set in iptables. That is to say, the mac address in the packet received by the host is not from the host.

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.