Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Updated VPN Template to support lists of Host Inbound Protocols and S…
Browse files Browse the repository at this point in the history
…ervices
  • Loading branch information
kwbales committed Mar 27, 2015
1 parent 61132be commit dd6a4b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

srx.vm.synced_folder "", "/vagrant", disabled: true

srx.ssh.insert_key = false

srx.vm.provision "file", source: "scripts/srx-setup.sh", destination: "/tmp/srx-setup.sh"
srx.vm.provision :host_shell do |host_shell|
host_shell.inline = 'vagrant ssh srx -c "/usr/sbin/cli -f /tmp/srx-setup.sh"'
Expand Down
13 changes: 11 additions & 2 deletions ansible/playbooks/templates/interfaces_zone.set.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
set security zones security-zone {{ i.zone }} interfaces {{ i.interface -}}.{{ i.unit -}}
{% endif %}

{% if i.inbound_type %}
set security zones security-zone {{ i.zone }} interfaces {{ i.interface }}.{{ i.unit }} host-inbound-traffic {{ i.inbound_type }} {{ i.system_service }}
{% if i.hit_protocols %}
{% for protocol in i.hit_protocols %}
set security zones security-zone {{ i.zone }} interfaces {{ i.interface }}.{{ i.unit }} host-inbound-traffic protocols {{ protocol }}
{% endfor %}
{% endif %}

{% if i.hit_services %}
{% for service in i.hit_services %}
set security zones security-zone {{ i.zone }} interfaces {{ i.interface }}.{{ i.unit }} host-inbound-traffic system-services {{ service }}
{% endfor %}
{% endif %}

{% endfor %}
2 changes: 1 addition & 1 deletion ansible/playbooks/vpn_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
address_entries: [ {'name':'LocalNet','prefix':'172.16.0.0/24'},{'name':'PrivateNet','prefix':'192.168.10.0/24'},{'name':'PublicNet','prefix':'10.10.0.0/24'} ]
fw_policy_info: [ {'policy_name':'Allow_Policy','src_zone':'trust','dst_zone':'untrust','src_ips':['LocalNet'],'dst_ips':['PrivateNet'],'action':'permit','apps':['any']}]
mss_entries: [ {'protocol': 'ipsec-vpn', 'mss': '1350'} ]
interfaces: [ {'interface': 'st0', 'unit': '1', 'family': 'inet', 'addr_type': 'address', 'addr': '10.255.1.2/30', 'zone':'vpn', 'inbound_type': 'system-services', 'system_service': 'ping'} ]
interfaces: [ {'interface': 'st0', 'unit': '1', 'family': 'inet', 'addr_type': 'address', 'addr': '10.255.1.2/30', 'zone':'vpn', 'hit_protocols': ['ospf', 'bgp'], 'hit_services': ['ping', 'traceroute']} ]
ike: [ {'ike_name': 'ike-vpn', 'gateway_ip': '10.10.0.10', 'ext_interface': 'ge-0/0/2.0', 'ike_policy_name': 'ike-policy1', 'ike_policy_mode': 'main', 'ike_policy_proposal': 'standard', 'shared_secret': 'AwesomePassword123'} ]
ipsec: [ {'ipsec_policy_name': 'vpn-policy1', 'ipsec_policy_mode': 'standard', 'ipsec_vpn_name': 'ipsec-vpn', 'ike_gateway': 'ike-vpn', 'tunnel_int': 'st0.1'} ]

Expand Down

0 comments on commit dd6a4b4

Please sign in to comment.