LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   firewalld port forwarding specific ip how? (https://www.linuxquestions.org/questions/linux-security-4/firewalld-port-forwarding-specific-ip-how-4175562930/)

packets 01-02-2016 09:18 AM

firewalld port forwarding specific ip how?
 
I have migrated my application from CentOS 6 to CentOS 7. It is using firewalld so I need to convert my iptables script from my CentOS 6. I have 2 ip on a same nic (eth0)

eth0 - 1.1.1.1
eth0:0 - 1.1.1.2

1.1.1.1 has an application listening to port 25 and should receive traffic
1.1.1.2 has an application liestning to port 8025. It has port forwarding all traffic to port 25 going to 1.1.1.2 will be directed to port 8025.

The above is working in my iptables script but not on firewalld. I understand that firewalld works on zones and not by ip address destination. Is there a way I can configure both rules above in firewalld? I have configured port forwarding but not the first rule. If I telnet to 1.1.1.1 port 25, it is being directed to 8025. It should be directing to port 8025 since I have an application listening to port 25 of 1.1.1.1.

Code:

public (default, active)
  interfaces: eth0
  sources:
  services: dhcpv6-client smtp ssh
  ports: 110/tcp 3500/tcp 28/tcp 25/tcp 8025/tcp 587/tcp 143/tcp 26/tcp
  masquerade: yes
  forward-ports: port=25:proto=tcp:toport=8025:toaddr=1.1.1.2
  icmp-blocks:
  rich rules:


packets 01-02-2016 09:48 PM

Please disregard. I found a work around. I opted to use my iptables script and incorporate it on systemd.


All times are GMT -5. The time now is 09:15 PM.