I have a Gentoo Linux server. Server is connected to two networks: internal and external.
Internal network ip: 192.168.1.200 External network ip: 192.168.0.2
If I'm trying to make request from server to itself, it uses external network IP. Connecting to nginx using Wget gives me this log record:
server ~ # tail -n 1 /var/log/nginx/error_log 192.168.0.2 - - [27/Aug/2014:19:04:42 +0300] "GET / HTTP/1.1" 200 5 "-" "Wget/1.14 (linux-gnu)"
Despite that I connecting directly to 192.168.1.200:
server ~ # wget http://192.168.1.200/
Routing table (metric is higher on external network, but seems ignored): ip route show
server ~ # ip route 192.168.0.0/30 dev wan scope link metric 20 192.168.1.0/24 dev lan scope link metric 10
ip route get:
server ~ # ip route get 192.168.1.200 local 192.168.1.200 dev lo src 192.168.1.200 cache <local>
How can I get this machine to connect using 192.168.1.200 to itself, instead of 192.168.0.2?