ustcweizhou opened a new pull request #3851: vpc: set traffic type of private 
gateway IP to Public to fix keepalived misconfiguration
URL: https://github.com/apache/cloudstack/pull/3851
 
 
   
   
   ## Description
   <!--- Describe your changes in detail -->
   
   In VPC, the private gateway has traffic type as Guest not Public.
   This leads to keepalived misconfiguration in VPC with redundant VRs.
   
   There are some commits (eg 65cb22216aa1d5d6257f99d4ad84f80c319cdea9 and 
f4f9b3ab4ef2ef34e4d8a04c6ebfbf0784497227) for this issue, however the issue 
still exists in 4.13 and 4.14.
   
   Simply setting the traffic type of ip address (of private gateway) to Public 
fixes the issue.
   
   Fixes: #3402 
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the 
boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   <!-- see how your change affects other areas of the code, etc. -->
   
   Before change,
   
   In VPC master VR (redundant), IP of private gateway is added in keepalived, 
and gateway of private gateway is also added to ethX which is obviously wrong. 
   nw_type of ethX is 'guest' in /etc/cloudstack/ips.json
   
   ```
   root@r-181-VM:~# grep virtual_ipaddress /etc/keepalived/keepalived.conf -A5
       virtual_ipaddress {
           10.11.112.254/24 brd 10.11.112.255 dev eth6
           192.168.0.2/27 brd 192.168.0.31 dev eth5
           192.168.0.129/26 brd 192.168.0.191 dev eth4
           192.168.0.65/26 brd 192.168.0.127 dev eth3
       }
   
   8: eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UP group default qlen 1000
       link/ether 1e:00:65:00:01:ef brd ff:ff:ff:ff:ff:ff
       inet 10.11.112.10/24 brd 10.11.112.255 scope global eth6
          valid_lft forever preferred_lft forever
       inet 10.11.112.254/24 brd 10.11.112.255 scope global secondary eth6
          valid_lft forever preferred_lft forever
   
     "eth6": [
       {
         "add": true,
         "broadcast": "10.11.112.255",
         "cidr": "10.11.112.10/24",
         "device": "eth6",
         "first_i_p": false,
         "gateway": "10.11.112.254",
         "netmask": "255.255.255.0",
         "network": "10.11.112.0/24",
         "new_nic": false,
         "nic_dev_id": 6,
         "nw_type": "guest",
         "one_to_one_nat": false,
         "public_ip": "10.11.112.10",
         "size": "24",
         "source_nat": false,
         "vif_mac_address": "1e:00:65:00:01:ef"
       }
     ],
   ```
   
   After change, private gateway IP is not added in keepalived, gateway is not 
added to ethX. 
   nw_type of ethX is 'public' in /etc/cloudstack/ips.json
   ```
   root@r-187-VM:~# grep virtual_ipaddress /etc/keepalived/keepalived.conf -A5
       virtual_ipaddress {
           192.168.0.2/27 brd 192.168.0.31 dev eth5
           192.168.0.129/26 brd 192.168.0.191 dev eth4
           192.168.0.65/26 brd 192.168.0.127 dev eth3
       }
   
   
   8: eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UP group default qlen 1000
       link/ether 1e:00:f2:00:01:ef brd ff:ff:ff:ff:ff:ff
       inet 10.11.112.10/24 brd 10.11.112.255 scope global eth6
          valid_lft forever preferred_lft forever
   
   
     "eth6": [
       {
         "add": true,
         "broadcast": "10.11.112.255",
         "cidr": "10.11.112.10/24",
         "device": "eth6",
         "first_i_p": false,
         "gateway": "10.11.112.254",
         "netmask": "255.255.255.0",
         "network": "10.11.112.0/24",
         "new_nic": false,
         "nic_dev_id": 6,
         "nw_type": "public",
         "one_to_one_nat": false,
         "public_ip": "10.11.112.10",
         "size": "24",
         "source_nat": false,
         "vif_mac_address": "1e:00:f2:00:01:ef"
       }
     ],
   ```
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md)
 document -->
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to