888 Commits

Author SHA1 Message Date
Wilder Rodrigues
3cfc4cff80 Fixing the dhcpsrvr iptables file
- Instead of changing the router type in a local variable, lets have a dedicated file for the dhcpsrvr routers
   - The file is called iptables-dhcpsrvr, just like we have iptables-vpcrouter and iptables-router
2015-09-25 16:10:43 +02:00
Remi Bergsma
4c8f4ac341 Merge pull request #842 from jayapalu/shareNwVR
CLOUDSTACK-8843: Fixed issue in default iptables rules on shared network VROn basic zone share network VR default iptables rules are not applied correctly. Due to this ssh to VR got failed.
In shared network the VR type is 'dhcpsrvr' not router. So corrected it in the ''del_standard' method to select the correct type.

Testing:
1. VR is deployed correctly.
2. Tested restart, stop, start VR.
3. New VM deployment is success.
4. ssh to VR from the host is successful.
5. iptables rules on the VR came up correctly.
below is the output from the VR:
iptables -L INPUT -nv
Chain INPUT (policy DROP 16 packets, 1056 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            224.0.0.18
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            225.0.0.50
  104  9800 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
  281 36500 ACCEPT     all  --  eth1   *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  eth2   *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    6   504 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
    2   656 ACCEPT     udp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            udp dpt:67
   13   780 ACCEPT     tcp  --  eth1   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:3922 state NEW,ESTABLISHED
    0     0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 state NEW
    0     0 ACCEPT     tcp  --  eth0   *       10.147.40.0/23       0.0.0.0/0            state NEW tcp dpt:8080

* pr/842:
  CLOUDSTACK-8843: Fixed issue in default iptables rules on shared network VR

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-24 16:42:42 +02:00
Remi Bergsma
4420f48e3e Merge pull request #882 from jayapalu/CLOUDSTACK-8881
CLOUDSTACK-8881: Fixed Static and PF configuration issue1. For static nat filter rules are not configured in VR.
2. Corrected vm ip in PF rule.

* pr/882:
  CLOUDSTACK-8881: Fixed Static and PF configuration issue

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-24 15:36:18 +02:00
Remi Bergsma
649a4bdc76 Merge pull request #881 from jayapalu/CLOUDSTACK-8905
CLOUDSTACK-8905: Fixed hooking egress rulesAdded hooking the FIREWALL_EGRESS_RULES chain into FW_OUTBOUND chain.
With this egress rules will effective.

* pr/881:
  CLOUDSTACK-8905: Fixed hooking egress rules

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-24 15:36:04 +02:00
Remi Bergsma
4018d47ef8 Merge pull request #870 from jayapalu/CLOUDSTACK-8874
Configured dnsmasq to listen on all interfaces so that vpn  client gets dns1. Dnsmasq is not listening on the ppp+ interfaces due to this remote access vpn clients dns requests are  dropped.

2. Configured the dnsmasq to listen on all the interfaces except public. There is firewall to allow only specific cidr to allow the dns requests.

Tested from windows client nslookup.

* pr/870:
  Configured dnsmasq to listen on all interfaces so that vpn  client gets dns

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-24 15:35:48 +02:00
Remi Bergsma
a5a5f612ea Merge pull request #867 from jayapalu/CLOUDSTACK-8891
CLOUDSTACK-8891: Fixed default iptables rules on VR  for guest trafficVR default iptables rules in INPUT chain are configured partially.
In CsAddress.py rules are configured while configuring public interface, guest interface post configuration is missed. Fixed to configure guest post configuration so that iptables rules are configured.

Testing:
1. Deployed vm in the network.
2.iptables rules on the VR configured correctly.
3.VM got the dhcp ip address from the VR.

* pr/867:
  CLOUDSTACK-8891: Fixed default iptables rules on VR  for guest traffic

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-24 15:35:33 +02:00
Jayapal
40138d2e99 CLOUDSTACK-8881: Fixed Static and PF configuration issue 2015-09-24 17:22:29 +05:30
Jayapal
2bf7fb4b63 CLOUDSTACK-8905: Fixed hooking egress rules 2015-09-24 17:06:11 +05:30
Jayapal
746a5dc48e CLOUDSTACK-8891: Fixed default iptables rules on VR for guest traffic 2015-09-24 12:49:43 +05:30
Jayapal
dbedfe2557 Configured dnsmasq to listen on all interfaces so that vpn client gets dns 2015-09-22 14:10:48 +05:30
SudharmaJain
56d4429500 CLOUDSTACK-8863: VM doesn't reconnect to internet post VR RESTART/STOP-START/RECREATE 2015-09-17 11:50:21 +05:30
Jayapal
a15df0569f CLOUDSTACK-8843: Fixed issue in default iptables rules on shared network VR 2015-09-16 15:24:34 +05:30
wilderrodrigues
6b9e2ac16a Merge pull request #800 from bvbharatk/CLOUDSTACK-8798
CLOUDSTACK-8798 Fixed the vrrp virtual ip config in case of rvr enablFixed the vrrp virtual ip config in case of rvr enabled isolated networks.
changed the CsRedundant.py to bring down the public interface when rvr changes state to
backup. Also fixed vrrp authentication for isolated networks.

This fix dose not effect the vpc networks. it is only meant for rvr isolated networks.

manullay deployed a vm in rvr enabled isolated network and ran the tests below.

nosetests --with-marvin --marvin-config=/marvin-config test/integration/component/test_redundant_router_services.py

Test redundant router internals ... === TestName: test_enableVPNOverRvR | Status : SUCCESS ===

----------------------------------------------------------------------
Ran 1 test in 633.336s

nosetests --with-marvin --marvin-config=/marvin-config test/integration/component/test_redundant_router_cleanups.py

Test network garbage collection with RVR ... === TestName: test_network_gc | Status : SUCCESS ===
ok
Test restarting RvR network without cleanup ... === TestName: test_restart_ntwk_no_cleanup | Status : SUCCESS ===
ok
Test restart RvR network with cleanup ... === TestName: test_restart_ntwk_with_cleanup | Status : SUCCESS ===

----------------------------------------------------------------------
Ran 3 tests in 2120.263s

* pr/800:
  CLOUDSTACK-8798 Fixed the vrrp virtual ip config in case of rvr enabled isolated networks. changed the CsRedundant.py to bring down the public interface when rvr changes state to backup. Also fixed vrrp authentication for isolated networks.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-09-11 15:27:41 +02:00
Bharat Kumar
b66dcda49f CLOUDSTACK-8799 fixed for vpc networks. 2015-09-11 14:57:32 +02:00
Bharat Kumar
1a02773b55 CLOUDSTACK-8799 fixed the defalut routes
CLOUDSTACK-8799 made changes to fix CsRedundant.py
2015-09-11 14:57:32 +02:00
Bharat Kumar
6f68ecc3bf CLOUDSTACK-8798 Fixed the vrrp virtual ip config in case of rvr enabled isolated networks.
changed the CsRedundant.py to bring down the public interface when rvr changes state to
backup. Also fixed vrrp authentication for isolated networks.
2015-09-10 22:42:12 -07:00
Jayapal
33f4f952cf CLOUDSTACK-8690: Updated the iptables order 2015-09-09 10:50:50 +05:30
Jayapal
f661ac0a2a CLOUDSTACK-8690:Added remote access vpn and vpn users configuration 2015-09-09 10:50:50 +05:30
wilderrodrigues
237e0e4611 Merge pull request #765 from schubergphilis/fix/default_policies
CLOUDSTACK-8688 - default policies for INPUT and FORWARD should be set to DROP instead of ACCEPT

  - In order to be able to access the routers via the link local interface, we have to add a rules with NEW and ESTABLISHED state

* pr/765:
  CLOUDSTACK-8688 - Adding Marvin tests in order to cover the fixes applied
  CLOUDSTACK-8688 - default policies for INPUT and FORWARD should be set to DROP instead of ACCEPT

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-09-08 13:45:19 +02:00
wilderrodrigues
f5e5f4d002 CLOUDSTACK-8688 - default policies for INPUT and FORWARD should be set to DROP instead of ACCEPT
- In order to be able to access the routers via the link local interface, we have to add a rules with NEW and ESTABLISHED state
2015-08-31 12:43:04 +02:00
Bharat Kumar
18dbc0c4cb CLOUDSTACK-8725 RVR functionality is broken in case of isolated networks, conntrackd fails to start.
Rebased with master. This closes #692
2015-08-31 11:54:11 +05:30
Michael Andersen
a9eb4ba5c9 Fixed defaultroute on VPC routers in CsRoute and CsAddress
Refactored CsRoute
2015-08-24 13:35:29 +02:00
Michael Andersen
bb93a61ee7 pep8 cleanup 2015-08-24 13:35:01 +02:00
Remi Bergsma
7ddec661ca Merge pull request #690 from jayapalu/vpn
CLOUDSTACK-8710: Fixed applying iptables rules for s2s vpn
@remibergsma @wilderrodrigues
Moved applying iptables rules apply after vpn configuration so that vpn specific rules also get applied

* pr/690:
  CLOUDSTACK-8710: Fixed applying iptables rules for s2s vpn

This closes #690

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-14 09:11:21 +02:00
Remi Bergsma
4f8ab51f7f do not log sensitive site-to-site VPN PSK
Logging before:
2015-08-12 16:30:07,126 Searching for 192.168.23.6  and replacing with 192.168.23.6 192.168.23.5: PSK "preSharedKey"

Logging after:
2015-08-12 16:30:07,126 Searching for 192.168.23.6  and replacing with 192.168.23.6 192.168.23.5: PSK "****"
2015-08-14 09:07:25 +02:00
Remi Bergsma
9b97719c5c tighten security of site-to-site VPN
It was like this in 4.4 and 4.5
2015-08-14 09:05:59 +02:00
Remi Bergsma
382458317e CLOUDSTACK-8730: fix s2s iptables rules and ipsec config
For site2site VPN to work, we need a default gateway to be set.
See CLOUDSTACK-8685
2015-08-14 09:02:21 +02:00
Jayapal
da9e757b8e CLOUDSTACK-8710: Fixed applying iptables rules for s2s vpn 2015-08-13 14:07:12 +05:30
Jayapal
97eb0f7528 CLOUDSTACK-8707: Removed convert sec to h on esp_lifetime
This closes #655
2015-08-05 14:14:55 +05:30
Jayapal
c13201353c CLOUDSTACK-8707: Added missed esp policy esp is added with esp_lifetime instead of esp_policy, corrected it. 2015-08-05 14:14:46 +05:30
Kishan Kavala
bccd344796 CLOUDSTACK-8683: process cmd_line.json for shared network VR in cloud-early-config
This closes #634
2015-07-29 15:57:19 +05:30
Kishan Kavala
90137acda2 VR type in shared network is dhcpsrvr. Ips are being removed due to this issue
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #627
2015-07-28 13:43:09 +02:00
wilderrodrigues
b29d8e7280 CLOUDSTACK-8616 - Adding important remark about the use of buildsystemvm.sh
- For package installation/update please refer to: cloud-tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #587
2015-07-16 13:14:49 +02:00
wilderrodrigues
4b3db3d117 CLOUDSTACK-8616 - Add a cron job to restart ConntrackD on reboot
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-16 13:14:48 +02:00
wilderrodrigues
f78a65c05a CLOUDSTACK-8616 - Installing KeepaliveD from Debian Wheezy backports
- preempt delay reverted on version 1.2.13 - from the backports
     - vrrp : Revert "Honor preempt_delay setting on startup.".
     - See changelog: http://www.keepalived.org/changelog.html
   - Refactoring some variable names to avoid misunderstanding

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-16 13:14:48 +02:00
wilderrodrigues
12ee36a55f CLOUDSTACK-8616 - Add keepalived start on reboot
- Runs check_heartbeat.sh every 30 seconds

CLOUDSTACK-861 - Copy/Paste error

   - Paste the wrong command in the crontab line.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-16 13:14:48 +02:00
wilderrodrigues
20be22c698 CLOUDSTACK-8616 - Removing the Priority form KeepaliveD configuration
- We use no preempt mode with state set as EQUAL to both nodes, no need to have Priotities setup
   - Do not add IPs as comments to the configuration. If a new guest interface is added, the file will change anyway.
     - This was used in the past when keepalived would restart for each new interface added
   - Removed the long sleep form the tests: we now sleep 5 seconds per PF rule added

CLOUDSTACK-8616 - Fix keepalived.ts/2 files comparison

   - Add call to set_fault() in case of router transits to that state
   - Removing commented out code

CLOUDSTACK-8616 - Fixing check_heartbeat.sh.templ

CLOUDSTACK-8616 - Call set_fault from the check_heartbeat.sh script

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-16 13:14:48 +02:00
Ian Southam
b7b54f1680 Fixes to enable test to succeed. Small change to Marvin to be able to override retries
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-08 11:19:12 +02:00
David Bierce
646e0d99dd Always enter chap-secrets as a quoted field. In the event of special characters it creates and deletes the entry properly, in the event there are not special characters there is no change behavior.
Signed-off-by: Remi Bergsma <apache@remi.nl>

This closes #307
2015-05-27 13:42:48 +02:00
Ian Southam
56483436f0 Pep8 changes that got lost with the strange double push request problem last time 2015-05-26 07:07:43 -04:00
Abhinandan Prateek
ad6ac9bb10 CLOUDSTACK-8488: network with LB fails to restart as the bash script mangles the escape characters, fixed 2015-05-22 16:24:20 +05:30
Ian Southam
ab915b6c92 Allow forward to fix port forwarding rules 2015-05-19 12:54:38 +00:00
Rajani Karuturi
0b8355920e Merge branch 'volume-upload' into master
This closes #206
2015-04-29 11:12:53 +05:30
Rohit Yadav
6829399647 CLOUDSTACK-7493: ignore errors on removal of iptables chains that don't exist
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit f26ae6eb39fbc3d8e86aca492447fac5360ed130)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-23 14:19:46 +02:00
Rohit Yadav
f55658dab2 vpn_l2tp: fix variable assignment, fails L2TP VPN
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 5cba4109377ff6e3cfe87a998fb2cac6aa7639dd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-23 14:19:34 +02:00
wilderrodrigues
2fad87d3f3 Make the routers persistent
- After configuration save the ipdated in files
    * /etc/iptables/router_rules.v4 and /etc/iptables/router_rules.v6
    * Reload the configuration on reboot via the /etc/rc.local using iptables-restore
2015-04-14 15:09:47 +02:00
Rene Moser
0ada08aa85 CLOUDSTACK-6885: fix logrotate on VR to depend on size
In 6ac06e5e5e3ceed4a3e3a86ea5f82ffb59c266f2 logrotate was changed to run hourly.
Some logrotate configs still have set `daily` only which results in logs not
rotated hourly. The only way to ensure the log is rotated is to use size.

This closes #162

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-14 00:49:28 +05:30
wilderrodrigues
cb2b9e870b Fixing the communication with VM via Public IP
- Pub IP port forwarding and static NAT fixed for single VPCs
   - Pub IP port forwarding fixed for redundant VPCs

[wip] fix static NAT for redundant VPCs

This closes #150
2015-04-08 16:04:55 +02:00
wilderrodrigues
3d22a16c4f Bump priority stragety is no longer used for redundant virtual routers
- With the changes added by the rVPC work, the bump priority became deprecated.
     This commit includes a refactor to get it removed from the following resources:
     * Java classes
     * domain_router table - removing the is_priority_bumpup column
     * Fixing unit tests

All changes were tested with:

XenServer 6.2 running under our VMWare zone
CloudStack Management Server running on MacBook Pro
MySql running on MackBook Pro
Storage Type: Local
2015-04-02 21:50:49 +02:00
Rohit Yadav
0540ba1b30 systemvm: fix socat usage
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 888f67f0bdc3e76c452c2dc3f7715f2df12bda7d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-30 13:50:39 +05:30