Accessing localhost within the system redirecting to pfsense login page



  • Hello,

    I have installed pfsense in our company,I have an issue with this installation.When our developers accessing to localhost in their system ,its redirecting to pfsense login page.

    Can anyone please help in solving this issue.

    Thanks in advance.


  • Netgate Administrator

    You mean the pfSense DNS forwarder is returning 192.168.1.1 for queries for 'localhost' rather than 127.0.0.1?

    Steve


  • Rebel Alliance Global Moderator

    That seems quite odd, you sure your not doing a query for localhost.something?

    Clients should not even query for localhost to their dns since it should be in their local host file, or in new say windows systems it is handled via the local dns client

    see in the windows host file

    localhost name resolution is handled within DNS itself.

    127.0.0.1      localhost

    ::1            localhost

    And even if you did a query to pfsense for just localhost - it would return 127.0.0.1

    ; <<>> DiG 9.10-P2 <<>> localhost @192.168.1.253
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19328
    ;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;localhost.                    IN      A

    ;; ANSWER SECTION:
    localhost.              86400  IN      A      127.0.0.1

    ;; Query time: 4 msec
    ;; SERVER: 192.168.1.253#53(192.168.1.253)
    ;; WHEN: Tue Aug 19 10:34:49 Central Daylight Time 2014
    ;; MSG SIZE  rcvd: 43


  • Netgate Administrator

    Reading this again, do you mean that developers are trying to access local servers and are getting the pfSense webgui? That's a much more likely result and there are several ways to avoid it:
    https://doc.pfsense.org/index.php/Why_can't_I_access_forwarded_ports_on_my_WAN_IP_from_my_LAN/OPTx_networks

    Steve


  • Rebel Alliance Global Moderator

    This seems pretty clear that users are trying to access localhost on their system

    "When our developers accessing to localhost in their system ,its redirecting to pfsense login page."

    Which really seems impossible to me.

    So OP - please clarify when someone puts http://localhost/ in their browser they get the pfsense web gui??  And pfsense is not installed on their machines as say a VM or something?



  • Thanks for reply,

    I have installed pfsense as a VM in ESXI server and assigned a  static ip of "192.168.2.23" .This ip is assigned by windows server 2012. When i type localhost or 127.0.0.1 in client system's browser its displaying pfsense admin login page.


  • Rebel Alliance Global Moderator

    Sorry but that just doesn't seem likely - pics please.

    Please post the ipconfig /all of your client machine..  Sorry but going to 127.0.0.1 is not going to go across the network and connect to pfsense lan IP which you say is 192.168.2.23

    Is your client also a vm on this esxi host?



  • client is another computer in lan and its not a VM in ESXI server.

    IPCONFIG Details:
    Ethernet adapter Local Area Connection:

    Connection-specific DNS Suffix  . : greenbuds.loc
      Link-local IPv6 Address . . . . . : fe80::1455:287:cb08:6e8e%11
      IPv4 Address. . . . . . . . . . . : 192.168.2.114
      Subnet Mask . . . . . . . . . . . : 255.255.255.0
      Default Gateway . . . . . . . . . : 192.168.2.1





  • Netgate Administrator

    Hmm, curious.
    Yes, I think we're going to need more clarification here, a diagram perhaps. How is the test client connected to the VM host?
    Your pfSense LAN is set to DHCP with the Win2k12 server assigning it? Is that also virtual?

    Steve



  • Both pfsense and winserver are VM's in ESXI server. IP's for client computers are assigned by winserver and DHCP for pfsense lan interface is disabled. Proxy server configuration for client computer is configured through INTERNET OPTIONS in Windows 7.


  • Rebel Alliance Global Moderator

    "Proxy server configuration for client computer is configured through INTERNET OPTIONS in Windows 7"

    And are you bypassing local connections for this proxy setting?  If not your asking your proxy for localhost, which I take it your proxy is pfsense?




  • Hello,

    Finally it solved with the help of your post.

    Thanks for all of your excellent support.

    -Vasu