-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* depends 'sysctl' and 'iptables' * setup-ip-masquerading.rb -> setup-ip-masquerading.rb ** setctl net.ipv4.ip_forward ** add a template 'masquerade.erb' * add default recipe (include all other recipes)
- Loading branch information
1 parent
b9540a6
commit 1f9f2e2
Showing
6 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Cookbook Name:: vpcnat | ||
# Recipe:: default | ||
# | ||
# Copyright 2014, WESEEK, Inc. | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
|
||
include_recipe 'vpcnat::disable-source-dest-check' | ||
include_recipe 'vpcnat::setup-ip-masquerading' | ||
include_recipe 'vpcnat::setup-heartbeat-script' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Cookbook Name:: vpcnat | ||
# Recipe:: setup-iptables-rules | ||
# | ||
# Copyright 2014, WESEEK, Inc. | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
|
||
|
||
Chef::Log.info("setting up IP Masquerading") | ||
|
||
# setting net.ipv4.ip_forwart=1 | ||
include_recipe 'sysctl' | ||
|
||
sysctl_param 'net.ipv4.ip_forward' do | ||
value 1 | ||
end | ||
|
||
|
||
# setting iptables | ||
include_recipe 'iptables' | ||
|
||
iptables_rule "masquerade" do | ||
source "iptables/masquerade.erb" | ||
variables({ | ||
:ipmasq_src => node["vpcnat"][:ipmasq_src] | ||
}) | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-t nat -A POSTROUTING -s <%= @ipmasq_src %> -j MASQUERADE |