Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using the iptables puppet module what syntax to I need to allow port redirection from port 443 to 8443 on the local host?

It looks like it should be the syntax should be the following but I'm not sure how to translate this into a manifest.

iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443 

Existing puppet rules:

firewall { '100 tomcat rewrite 443 to 8443':
  table     => 'nat',
  chain     => 'PREROUTING',
  jump      => 'REDIRECT',
  proto     => 'tcp',
  dport     => '443',
  toports   => '8443',
}

firewall { '100 allow access to tomcat 8443 https':
  proto   => 'tcp',
  state   => ['NEW'],
  dport   => '8443',
  action  => 'accept',
}
share|improve this question
1  
One thing I don't think I'd trust puppet to do. Firewalls. –  Tom O'Connor Dec 27 '12 at 23:54
add comment

1 Answer

up vote 1 down vote accepted
firewall {'XXX rule':
 destination => '127.0.0.1',
 dport => '443',
 proto => 'tcp',
 chain => 'OUTPUT',
 table => 'nat',
 jump => 'REDIRECT',
 toports => '8443'
 }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.