374 Commits

Author SHA1 Message Date
Wilder Rodrigues
80b51a7972 CLOUDSTACK-8947 - Adding some logging to better understand what's happening with the rules 2015-10-14 07:44:39 +02:00
Wilder Rodrigues
59bd935f3e CLOUDSTACK-8947 - Configure the firewall when the load balancer is setup
- Only restart HAproxy if it's not running yet
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
4a177031b0 CLOUDSTACK-8947 - Avoid multiple entries in the FW_EGRESS_RULES table 2015-10-14 07:44:38 +02:00
Wilder Rodrigues
052c0dc4c9 CLOUDSTACK-8947 - Open the input chain to IP when loadbalancer is configured
- Also remove the chain rule when it is removed.
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
cbd6464b88 CLOUDSTACK-8947 - FW_EGRESS should be added only to filter table 2015-10-14 07:44:37 +02:00
Wilder Rodrigues
cd8c3e97f5 CLOUDSTACK-8934 - Fix the AclIP class to make it configure the default FW policy 2015-10-11 14:57:33 +02:00
Wilder Rodrigues
b4dc392bfd CLOUDSTACK-8934 - Fix default EGRESS rules for isolated networks
- The default is Accept and will be changed based on the configuration of the offering.

CLOUDSTACK-8934 - The default egress is set as Deny in the router.

   - We had to change it on the Java side in order to make the apply it once the default is defined as allowed on the net offering
2015-10-11 14:57:32 +02:00
Wilder Rodrigues
45642b8382 CLOUDSTACK-8934 - Add default gateway when the public interface is up again 2015-10-11 14:57:12 +02:00
Wilder Rodrigues
9fe040e96d CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called
- Also refactored the copy() function under CsHelper.py
2015-10-06 16:41:15 +02:00
Wilder Rodrigues
260ff836b6 CLOUDSTACK-8915 - Reverting changes from commit id 1a02773b556a0efa277cf18cd099fc62a4e27706
- That's not the place to fix the default routes for redundant VPC,
   - Adding tests to cover PF and FW in isolated networks
     * Will still add some tests for egress as well
2015-10-06 16:41:14 +02:00
Wilder Rodrigues
3d34e4a52c CLOUDSTACK-8915 - Reverting changes from commit id 18dbc0c4cbe506ad698bc513c901dc2d0e48159f
- If the file is always copied, it will result in restarting keepalived everytime which makes the routers transit between master/backup
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
094d29d7cd CLOUDSTACK-8915 - VRRP needs a cidr in order to work properly
- The cidr was replaced by the single IP, which broke the feature.
   - Wait during transition from master to backup otherwise the test fails due to wronge state
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
0c752eab60 CLOUDSTACK-8915 - Rearrenging a bit the default route code in order to make it more clear 2015-10-06 16:41:13 +02:00
Wilder Rodrigues
c17fb0ff28 CLOUDSTACK-8915 - Add the default route only on address that have not been configured yet.
- In case of rVPC we experienced the wrong route being added to the VPC tiers
2015-10-06 16:41:12 +02:00
Wilder Rodrigues
09e05f2a06 Fixing the index out of bounds error in the check_if_link_up() function 2015-09-26 20:43:15 +02:00
Remi Bergsma
d83995e23c small cleanups 2015-09-26 20:33:21 +02:00
Wilder Rodrigues
a8fa3374da Fixing the defaut route for VPC routers 2015-09-26 20:30:49 +02:00
Wilder Rodrigues
595fa50b3b Formatting the get_gateway() method in the CsDatabag.py file 2015-09-25 16:11:32 +02:00
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