Ask Your Question
0

Firewall port forwarding issues

asked 2015-02-18 15:17:01 -0500

bpal gravatar image

Hi I'm trying to setup port forwarding with the firewall class.

I need to forward port 80 to 8090. My puppet pre.pp has the following:

firewall {'102 forward port 80 to 8090':
  table       => 'nat',
  chain       => 'PREROUTING',
  proto       => tcp,
  dport       => '80',
  jump        => 'REDIRECT',
  toports     => '8089',
}

This in turn creates the following rule:

-A PREROUTING -p tcp -m multiport --dports 80 -m comment --comment "102 forward port 80 to 8090" -j REDIRECT --to-ports 8089

What I would like is:

-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

The main difference is puppet is createing the rule with -m multiport vs -m tcp. This is the only difference I can see and with this difference my rule is not working.

So how can I change the -m to tcp or is there something else I am missing.

Thank you in advanced for the help.

edit retag flag offensive close merge delete

Comments

Talk about a noob mistake. This is what happens when you have been staring at something for to long. THANK YOU !!!!

bpal gravatar imagebpal ( 2015-02-19 15:14:58 -0500 )edit

Yep, been there before!

GregLarkin gravatar imageGregLarkin ( 2015-02-19 15:22:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-02-19 10:45:37 -0500

GregLarkin gravatar image

There are some inconsistencies in the code you posted - you want to forward to 8090, but your toports attribute value is 8089? Also, your desired rule has "--to-ports 8080"? The multiport option should not be an issue, so I would check the destination port number first.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-02-18 15:17:01 -0500

Seen: 671 times

Last updated: Feb 18 '15

Related questions