DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Security

OpenBSD Security Functionally paranoid!

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 19th June 2019
junk's Avatar
junk junk is offline
Port Guard
 
Join Date: Jun 2018
Posts: 17
Default NAT source address translation

Hello,

Could anyone help me please?

I'm trying to connect from 192.168.0.3 to 192.168.0.1:8080 and send that to 192.168.1.2:80 as if it were coming from 192.168.1.1.

Pretty silly but I don't know how. I've tried the following:

Code:
int_if1 = 192.168.0.1 #re0
int_if2 = 192.168.1.1 #re1
client = 192.168.0.3
server = 192.168.1.2

pass in on $int_if1 inet proto tcp from $client to $int_if1 port 8080 rdr-to $server port 80
pass out on $int_if1 inet proto tcp to $server port 80 received-on $int_if1 nat-to $int_if2
Code:
test# tcpdump -n -i re0 port 8080
tcpdump: listening on re0, link-type EN10MB
18:15:39.895350 192.168.0.3.44971 > 192.168.0.1.8080: S 4258345521:4258345521(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 3319586456 0> (DF)
18:15:40.156961 192.168.0.3.47237 > 192.168.0.1.8080: S 1293923870:1293923870(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 786111235 0> (DF)
18:15:45.892088 192.168.0.3.44971 > 192.168.0.1.8080: S 4258345521:4258345521(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 3319586468 0> (DF)
18:15:46.152135 192.168.0.3.47237 > 192.168.0.1.8080: S 1293923870:1293923870(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 786111247 0> (DF)
Code:
test# tcpdump -n -i re1 port 80  
tcpdump: listening on re1, link-type EN10MB
18:18:11.386568 192.168.0.3.7444 > 192.168.1.2.80: S 1435489758:1435489758(0) win 16384 <mss 1440,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 2917288379 0>
18:18:11.649978 192.168.0.3.21710 > 192.168.1.2.80: S 500167953:500167953(0) win 16384 <mss 1440,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 459285197 0>
18:18:17.378744 192.168.0.3.7444 > 192.168.1.2.80: S 1435489758:1435489758(0) win 16384 <mss 1440,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 2917288391 0>
18:18:17.648712 192.168.0.3.21710 > 192.168.1.2.80: S 500167953:500167953(0) win 16384 <mss 1440,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 459285209 0>

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
network address translation bsdsource OpenBSD Security 12 1st October 2016 10:36 PM
PF and NAT: Specify SRC IP Address? jasonvp FreeBSD Security 5 25th November 2015 08:04 PM
Other Open-source typeface “Hack” brings design to source code J65nko News 1 31st August 2015 03:06 PM
MAC address to IP rex FreeBSD General 9 11th November 2008 07:06 PM
Asking about IPv6 address berlowin Off-Topic 2 9th July 2008 02:39 AM


All times are GMT. The time now is 10:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick