Hello,
I am new to pf and want to learn how to use it but encounter some problems with port forwarding.
These are my hosts :
Host A : 89.28.16.166
Host B : 128.209.98.106
Host C : 89.85.24.118
From host A, I would like to ssh (port 887) to host B and be redirected to host C (port 888).
hostA> ssh 128.209.98.106 -p 887 -> 89.85.24.118 port 888
Host B :
/etc/rc.conf
/etc/sysctl.conf
/etc/pf.conf
I can ssh from host B to host C on port 888 :
Host C :
Accept all traffic.
On host B, I can see incoming traffic from host A on port 887
On host B, I can see outgoing forwarded traffic from host A to host C :
But on host C, I can't see any incoming traffic :
What do I wrong ? Can somebody help me ?
Thanks a lot...
Peter.
I am new to pf and want to learn how to use it but encounter some problems with port forwarding.
These are my hosts :
Host A : 89.28.16.166
Host B : 128.209.98.106
Host C : 89.85.24.118
From host A, I would like to ssh (port 887) to host B and be redirected to host C (port 888).
hostA> ssh 128.209.98.106 -p 887 -> 89.85.24.118 port 888
Host B :
/etc/rc.conf
Code:
gateway_enable="YES"
/etc/sysctl.conf
Code:
net.inet.ip.forwarding=1
net.inet.ip.fastforwarding=1
net.inet6.ip6.forwarding=1
/etc/pf.conf
Code:
set skip on lo0
rdr pass on vtnet0 proto tcp from any to any port 887 -> 89.85.24.118 port 888
I can ssh from host B to host C on port 888 :
# ssh 89.85.24.118 -p 888
Host C :
Accept all traffic.
On host B, I can see incoming traffic from host A on port 887
Code:
# tcpdump -nni vtnet0 'port 887'
11:11:15.614859 IP 89.28.16.166.36664 > 128.209.98.106.887: Flags [ S ], seq 3656692557, win 29200, options [mss 1452,sackOK,TS val 281541214 ecr 0,nop,wscale 7], length 0
On host B, I can see outgoing forwarded traffic from host A to host C :
Code:
# tcpdump -nni vtnet0 'port 888'
11:16:10.835463 IP 89.28.16.166.36875 > 89.85.24.118.888: Flags [ S ], seq 2038275656, win 29200, options [mss 1452,sackOK,TS val 281615020 ecr 0,nop,wscale 7], length 0
But on host C, I can't see any incoming traffic :
Code:
# tcpdump -i vtnet0 'port 888'
...
What do I wrong ? Can somebody help me ?
Thanks a lot...
Peter.