I'm trying to set up a reverse proxy for ssh connections to my NATed servers (using ROS 3.23 on RB450G) - I can't use DNAT or port forwarding because I have only one public IP and I'd like to access my servers via a "standard" port (80 for example, as that's always accessible from corporate firewalls)
My NAT setup is simple: public (1.2.3.4/32) and private (10.0.0.0/8) interfaces with srcnat masquerading:
Code: Select all
/ip address print
0 1.2.3.4/32 1.2.3.4 1.2.3.4 public
1 10.0.0.1/8 10.0.0.0 10.255.255.255 private
/ip firewall nat print
0 ;;; NAT Masquerade
chain=srcnat action=masquerade src-address=10.0.0.0/8
For example here is my setup for the ssh server running on 10.0.0.2:
Code: Select all
/ip proxy print
enabled: yes
src-address: 1.2.3.4
port: 80
... (default settings)
/ip proxy access print detail
0 dst-port=22 dst-host=10.0.0.2 method=CONNECT action=allow
1 src-address=0.0.0.0/0 action=deny
Code: Select all
CONNECT 10.0.0.2:22 HTTP/1.0
I can see with tcpdump on the ssh server that it actually sends a prompt back but it never reaches the client:
Code: Select all
...
15:59:06.549164 IP 10.0.0.2.ssh > 1.2.3.4.39360: Flags [P.], seq 1:33, ack 1, win 724, options [nop,nop,TS val 76274266 ecr 60744232], length 32
E..T..@.@.~.
...^..1......b..........W.....
...Z...(SSH-2.0-OpenSSH_5.1p1 De
15:59:06.549415 IP 1.2.3.4.39360 > 10.0.0.2.ssh: Flags [.], ack 33, win 1460, options [nop,nop,TS val 60744232 ecr 76274266], length 0
# That's the last packet sent
Any idea about what I'm doing wrong?
Thanks!
-- Arnaud