OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • 18.7.3 can't acces from WAN to ssh
« previous next »
  • Print
Pages: [1]

Author Topic: 18.7.3 can't acces from WAN to ssh  (Read 6257 times)

badwestguy

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
    • View Profile
18.7.3 can't acces from WAN to ssh
« on: September 26, 2018, 01:56:44 pm »
Hello OPNsense,


I recently decided to install opnsense as a firewall in my organization.

Before installing it as a main device, I decided to test its virtual version. Installed on one of the servers, indicated two virtual network adapters:
wan (dncp4) - 192.168.88.120/24 - received from my current router.
lan (static) - 10.10.1.1/24 - here works dhcp server


I created another virtual device (ubuntu 18.04) and connected it to the same network adapter.

After that, I turned on ssh on both network adapters (wan, lan), added rules for access, allowed the connection for root.

However, I have access only from the side of lan (from virtual ubuntu). The router remains unavailable from the wan network.


Configs here:





Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1677
  • Karma: 171
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #1 on: September 26, 2018, 03:04:40 pm »
Not a good idea to expose the SSH port to the WAN for obvious reasons. If you want to remote into the firewall you're always better off using a VPN.
Logged
OPNsense 21.7 - Qotom Q355G4 - ISP - Community Fibre 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

qinohe

  • Full Member
  • ***
  • Posts: 160
  • Karma: 19
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #2 on: September 26, 2018, 05:35:57 pm »
@ marjohn56, while I do agree to you that VPN is stronger, it probably don't matter now since he's behind a second router and could be for testing only ;)

@ badwestguy,

You don't have option 'Block private networks' enabled on the WAN interface?

Greetings, mark

Logged

badwestguy

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #3 on: September 26, 2018, 05:39:07 pm »
Thanks for answer, @marjohn56!


Yes, I know about the risks of using ssh at wan.


Now I want to configure web interface of the system (OPNsense) for using it in feature.
The main idea - edit files from wan port with sftp and ssh access.
Of course, I can doing it from PCs in LAN segment, but all this PC is virtual and it's not comfortable to work with OPNsense GUI from virtual PC with VNC.


Any idea how to connect from WAN to SSH?


Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1677
  • Karma: 171
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #4 on: September 26, 2018, 05:52:51 pm »
Yes, use OpnVPN, then you can SSH into the LAN side of OPNsense without any issues.
Logged
OPNsense 21.7 - Qotom Q355G4 - ISP - Community Fibre 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

badwestguy

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #5 on: September 26, 2018, 06:06:40 pm »
Quote from: qinohe on September 26, 2018, 05:35:57 pm
@ badwestguy,

You don't have option 'Block private networks' enabled on the WAN interface?

Greetings, mark


Both "Block private networks" and "Block bogon networks" is disabled.



Quote from: marjohn56 on September 26, 2018, 05:52:51 pm
Yes, use OpnVPN, then you can SSH into the LAN side of OPNsense without any issues.

It's much more harder to configure OpenVPN than only use ssh from WAN  :)
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1677
  • Karma: 171
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #6 on: September 26, 2018, 06:16:21 pm »
It takes all of 5 minutes to configure OpenVPN using the wizard, it's taken you longer than that already! 8)
Logged
OPNsense 21.7 - Qotom Q355G4 - ISP - Community Fibre 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: 18.7.3 can't acces from WAN to ssh
« Reply #7 on: September 26, 2018, 06:44:19 pm »
Your WAN is RFC1918 which is NOT routed to the public internet. You are probably behind a carrier grade nat which makes it impossible to reach your device via the internet or you are behind a home router which needs a port forward to make it work.
Logged

badwestguy

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #8 on: September 27, 2018, 03:12:00 pm »
Quote from: fabian on September 26, 2018, 06:44:19 pm
Your WAN is RFC1918 which is NOT routed to the public internet. You are probably behind a carrier grade nat which makes it impossible to reach your device via the internet or you are behind a home router which needs a port forward to make it work.

Yes, I know. This OPNsense installed on my server behind router.

It's IP - 192.168.88.120, my laptops IP - 192.168.88.85.
I want to connect from my laptop to OPNsense server with SSH.
All firewall rules is good (in my mind), all other settings is good (in my mind), but... I can't.


Any idea?



Quote from: marjohn56 on September 26, 2018, 06:16:21 pm
It takes all of 5 minutes to configure OpenVPN using the wizard, it's taken you longer than that already! 8)


Maybe it's good idea, but I want to connect via ssh, and not try everything in order to access from outside.

OPNsense is able to resolve the connection over ssh from the WAN network?
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13957
  • Karma: 1210
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #9 on: September 27, 2018, 04:04:04 pm »
Enable checkbox "Disable Reply-to" under Firewall: Settings: Advanced.


Cheers,
Franco
Logged

badwestguy

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #10 on: September 27, 2018, 06:26:50 pm »
Quote from: franco on September 27, 2018, 04:04:04 pm
Enable checkbox "Disable Reply-to" under Firewall: Settings: Advanced.

Thank you so much, Franco! It's help.


Maybe OPNsense team can add this to the manuals?
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13957
  • Karma: 1210
    • View Profile
Re: 18.7.3 can't acces from WAN to ssh
« Reply #11 on: September 27, 2018, 08:44:31 pm »
It's a complex set of preconditions where documentation doesn't work because you'll only find it if you know what you're looking for. :/

We made the GUI a bit more intuitive with https://github.com/opnsense/core/issues/2458 avoiding to set gateways for WAN saying they are only required in multi-WAN scenarios. If you go to WAN and set the gateway back to "Auto-detect" that will likely fix it too.


Cheers,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • 18.7.3 can't acces from WAN to ssh
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2