Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm looking for a solution for the following problem:
My server registers the internal ip address from the router when there is a connection from an external source.
But not always...
Here's my network setup:
ISP -- cablemodem -- router (PC with Coyote Linux) -- switch -- internal PC's (2x Windows workstations, 1x Fedora 5 server)
When I connect with SSH, mail or web from one of the workstations to the server, I get their ip's logged, but when I connect from outside the ip of the router is logged.
But on the other hand, in the mail Logwatch sends me, there are external ip's registered of people who fail to log in with SSH.
Some help resolving this problem would be apreciated.
Newbie me was still on the local network connecting trough the router to the server... This logged the IP of the router.
When I'm outside the local network, the external IP gets logged......
DNATing changes the packets that arrive at the server so they seem to originate from the router, which is why the router's IP is being logged.
With all due respect, this is not what DNATing does. Destination Network Address Translation does just that --- change the destination address (and maybe port) of a packet.
So for example, consider that I have one public ip address (64.179.4.146) and have setup a simple private network (192.168.0.0/24). On said network, I have a gateway which connects to both the internet (64.179.4.146) and the network (192.168.0.1). I also have an ssh server (192.168.0.3). If I go outside and start using the internet from a different machine (64.233.167.147), I want to ssh into my own. So I send a packet to my other ip (64.179.4.146) with tcp port 22. Now it is recieved by my gateway/router on the public interface. The destination packet of the interface is obviously the public ip, but the router knows that the packet was not intended for itself. What it does is change the destination address from 64.179.4.146 to 192.168.0.3. So ssh should recieve a source address matching the foreign ip.
What you were describing above is called SNAT (Source Network Address Translation).
Thanx for your explanation, it is perfectly correct and the examples is easy to understand too
However, maybe my post was a little ambigious (but I think it was also correct):
Quote:
Your router is setup to DNAT SSH traffic to the server, right?
Quote:
DNATing [Ed: At the Router] changes the packets that arrive at the server so they seem to originate from the router, which is why the router's IP is being logged.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.