Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
e9c1572e
Commit
e9c1572e
authored
Sep 26, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PF NAT stuff.
parent
f6d5cbd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
install/phases/boss/powder-fixed
install/phases/boss/powder-fixed
+14
-6
No files found.
install/phases/boss/powder-fixed
View file @
e9c1572e
#
#
# This is the powder-fixed specific parts of target system setup
# This is the powder-fixed specific parts of target system setup
#
#
...
@@ -241,17 +242,22 @@ sub Install($$$)
...
@@ -241,17 +242,22 @@ sub Install($$$)
Phase "nat", "Updating NAT configuration", sub {
Phase "nat", "Updating NAT configuration", sub {
my $bossip = $configvars{"TARGETSYS_BOSSIP"};
my $bossip = $configvars{"TARGETSYS_BOSSIP"};
my $opsip = $configvars{"TARGETSYS_OPSIP"};
my $opsip = $configvars{"TARGETSYS_OPSIP"};
my $mask = $configvars{"TARGETSYS_NETMASK"};
Phase "delete", "Deleting old configuration", sub {
Phase "delete", "Deleting old configuration", sub {
DeleteFileFatal($NATCONF);
DeleteFileFatal($NATCONF);
};
};
Phase "create", "Creating new configuration", sub {
Phase "create", "Creating new configuration", sub {
CreateFileFatal($NATCONF,
CreateFileFatal($NATCONF,
"# Packet normalization",
"# Packet normalization",
"scrub in all",
"scrub in all",
"",
"",
"# Allow outbound connections from the jail",
"# Exclude the local networks.",
"nat on xn0 from $opsip to any -> $bossip");
"no nat on xn0 from $opsip to ${opsip}/${mask}",
"no nat on xn0 from $opsip to ${bossip}/${mask}",
"",
"# Allow outbound connections from the jail",
"nat on xn0 from $opsip to any -> $bossip");
};
};
Phase "restart", "Restarting NAT", sub {
Phase "restart", "Restarting NAT", sub {
ExecQuietFatal("service pf restart");
ExecQuietFatal("service pf restart");
...
@@ -314,7 +320,9 @@ sub Install($$$)
...
@@ -314,7 +320,9 @@ sub Install($$$)
"route_outerboss=\"155.98.32.70 155.98.36.1\"");
"route_outerboss=\"155.98.32.70 155.98.36.1\"");
push(@strings,
push(@strings,
"static_routes=\"\$static_routes outerboss outerboss\"");
"static_routes=\"\$static_routes outerboss outerboss\"");
# Nat config.
push(@strings,
"pf_enable=\"YES\"", "pf_rules=\"/etc/pf.nat\"");
#
#
# Okay, we want to comment out a bunch of stuff.
# Okay, we want to comment out a bunch of stuff.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment