View Single Post
Old 22nd June 2019
junk's Avatar
junk junk is offline
Port Guard
 
Join Date: Jun 2018
Posts: 12
Default

This also works now:

Code:
int_if1 = 192.168.0.1
int_if2 = 192.168.1.1
client = 192.168.0.3
server2 = 192.168.1.3

pass in on $int_if1 inet proto tcp from $client to $int_if1 port 8080 rdr-to $server2 port 80
pass out on $int_if1 inet proto tcp to $server2 port 80 received-on $int_if1 nat-to $int_if1 #(or even $int_if2)
Code:
test# tshark -t ad -r re0.dump
1 2019-06-22 17:27:32.222346     192.168.0.3 → 192.168.0.1     TCP 34249 8080 34249 → 8080 [SYN] Seq=0 Win=16384 Len=0 MSS=1460 SACK_PERM=1 WS=64 TSval=1574527048 TSecr=0
2 2019-06-22 17:27:32.228595     192.168.0.1 → 192.168.0.3     TCP 8080 34249 8080 → 34249 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0 MSS=1440 SACK_PERM=1 TSval=48477 TSecr=1574527048 WS=2
3 2019-06-22 17:27:32.228741     192.168.0.3 → 192.168.0.1     TCP 34249 8080 34249 → 8080 [ACK] Seq=1 Ack=1 Win=16384 Len=0 TSval=1574527048 TSecr=48477
4 2019-06-22 17:27:32.229366     192.168.0.3 → 192.168.0.1     HTTP 34249 8080 GET / HTTP/1.1 [Packet size limited during capture]
5 2019-06-22 17:27:32.232756     192.168.0.1 → 192.168.0.3     TCP 8080 34249 8080 → 34249 [ACK] Seq=1 Ack=383 Win=6864 Len=0 TSval=48478 TSecr=1574527048
6 2019-06-22 17:27:32.238640     192.168.0.1 → 192.168.0.3     HTTP 8080 34249 HTTP/1.0 302 Redirect [Packet size limited during capture]
...
Code:
test# tshark -t ad -r re1.dump
1 2019-06-22 17:27:32.222418     192.168.0.3 → 192.168.1.3     TCP 34249 80 34249 → 80 [SYN] Seq=0 Win=16384 Len=0 MSS=1440 SACK_PERM=1 WS=64 TSval=1574527048 TSecr=0
2 2019-06-22 17:27:32.228550     192.168.1.3 → 192.168.0.3     TCP 80 34249 80 → 34249 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0 MSS=1460 SACK_PERM=1 TSval=48477 TSecr=1574527048 WS=2
3 2019-06-22 17:27:32.228794     192.168.0.3 → 192.168.1.3     TCP 34249 80 34249 → 80 [ACK] Seq=1 Ack=1 Win=16384 Len=0 TSval=1574527048 TSecr=48477
4 2019-06-22 17:27:32.229408     192.168.0.3 → 192.168.1.3     HTTP 34249 80 GET / HTTP/1.1 [Packet size limited during capture]
5 2019-06-22 17:27:32.232710     192.168.1.3 → 192.168.0.3     TCP 80 34249 80 → 34249 [ACK] Seq=1 Ack=383 Win=6864 Len=0 TSval=48478 TSecr=1574527048
6 2019-06-22 17:27:32.238592     192.168.1.3 → 192.168.0.3     HTTP 80 34249 HTTP/1.0 302 Redirect [Packet size limited during capture]
...
But the source address is not being translated??

Last edited by junk; 22nd June 2019 at 04:30 PM.
Reply With Quote