Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

missing -d flag from https://github.com/cloudfoundry-community/port-forwarding-boshrelease/blob/master/jobs/port_forwarding/templates/bin/forward_ports.sh.erb#L28 #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jobs/port_forwarding/templates/bin/forward_ports.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sysctl net.ipv4.conf.all.route_localnet=0
<% internal_ip = rule['internal_ip'] || "127.0.0.1" %>
<% internal_port = rule['internal_port'] || raise("Expected non-empty 'internal_port' on '#{rule.inspect}' rule") %>

sudo iptables -t nat -A portforwarding-release -p tcp --dport <%= external_port %> -j DNAT --to <%= internal_ip %>:<%= internal_port %>
sudo iptables -t nat -A portforwarding-release -p tcp -d <%= spec.networks.send(spec.networks.methods(false).first).ip %> --dport <%= external_port %> -j DNAT --to <%= internal_ip %>:<%= internal_port %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or spec.address? https://bosh.io/docs/jobs.html#properties

It might make more sense to add support for rule['external_ip'] though (maybe falling back to spec.address, unless people would genuinely want to listen on all IPs).


<% if internal_ip == "127.0.0.1" %>
sysctl net.ipv4.conf.all.route_localnet=1
Expand Down