Firewall marking service

Source: Internet
Author: User

 

The firewall tag can only define multiple services as the same class. How can we define all future requests from the same client to the same realserver? Use LVS persitence

 

Assume that a specific request, such as http and mail, of a specific client cip, is directed to the same realserver. The firewall should be marked on Director.

 

1. director:

 

Iptables-A mangle-t PREROUTING-I eth0-d $ vip-p tcp -- dprot 80-j MARK -- set-mark 20

 

Iptables-A mangle-t PREROUTING-I eth0-d $ vip-p tcp -- dprot 110-j MARK -- set-mark 20

 

// Immediately mark the incoming request

 

Ipvsadm-A-f 20-s rr-p

 

// Add a cluster service and specify it as the firewall editing type. Use the wheel call algorithm and specify the default timeout value, that is, persistent connection.

 

Ipvsadm-a-f 20-r $ Rip1-g

 

// Add the realserver and define it as the DR Model

 

Ipvsadm-a-f 20-r $ Rip2-g

 

 

 

 

 

This article is from the "Beryl" blog

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.