incoming IP address on forwarded port

Support for security such as Firewalls and securing linux
Post Reply
logicprobe
Posts: 6
Joined: 2018/03/04 05:51:53

incoming IP address on forwarded port

Post by logicprobe » 2018/03/07 18:02:43

When ports are forwarded from a gateway to a server, does the server see only the gateway's IP address, or does it see the IP address of the original, pre-forwarded incoming IP address?

I want the server to see the pre-forwarded IP address instead of the gateway's address for logging purposes, etc. Is that possible?

User avatar
avij
Forum Moderator
Posts: 2681
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: incoming IP address on forwarded port

Post by avij » 2018/03/07 18:20:03

You will see the original IP address.

User avatar
TrevorH
Forum Moderator
Posts: 23653
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: incoming IP address on forwarded port

Post by TrevorH » 2018/03/07 19:10:08

If you're using a port forward on a firewall then you'll see the original ip address. It's when you use a proxy server that you don't but you can get the proxy to add the original ip to the headers it passes.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

logicprobe
Posts: 6
Joined: 2018/03/04 05:51:53

Re: incoming IP address on forwarded port

Post by logicprobe » 2018/03/07 19:19:28

Thanks for the answers. I'm stumbling through setting up a VPS with firewalld doing port forwarding, and some of the details would be a lot harder to figure out without the help I'm receiving here.

Post Reply