DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Security

OpenBSD Security Functionally paranoid!

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th February 2015
bharathpaul bharathpaul is offline
New User
 
Join Date: Feb 2015
Posts: 2
Default Open BSD Nat configuration not working.

Hi,

I am new to Open BSD and trying to explore PF in open BSD.
I am trying to do NAT. I don't know, what i am missing in the configuration. Below is my topology.

node1 (eth1) -------- (re0) BSD (re1) ------------- (eth2) node2

IP:
node1 eth1's IP: 120.100.1.1
BSD re0's IP: 120.100.1.2
BSD re1's IP: 121.100.1.2
node2 eth2's IP: 121.100.1.1

BSD has another interface that is connected to other machines and i dont want to apply any rule over that interface as it is my default gateway. I wanted to perform the tests only on re0 and re1.

My intention is to mask my node1's IP with the different IP when i am trying to communication with node2.


Below is my pf.conf file:
Code:
int_if="re0"
wan_if="re1"

# options
set skip on lo


# match rules

match out on $wan_if inet from ($int_if:network) to any nat-to 19.1.1.0/24

I initiated ICMP ping from node1 and checked the packets in wireshark at node2. No address translation happened.

If someone helps me in figuring out the issue, it would be really really great.


OPEN BSD version: OpenBSD 5.6 (GENERIC)

Last edited by ocicat; 24th February 2015 at 09:38 PM. Reason: Please use [code] & [/code] tags when posting command-line output.
Reply With Quote
  #2   (View Single Post)  
Old 24th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Hello, and welcome!

Assuming $wan_if is your "external" interface, where you want NAT to be applied, try:
Code:
match out on $wan_if from !($wan_if) nat-to ($wan_if)
The first use of $wan_if is with "on", and refers to the interface specifically.
The next two uses of $wan_if are interpreted by PF as the network address of the interface, and are in parenthesis because the address is dynamic, and may change.

Your nat-to line had the wrong interface in parenthesis, and listed a specific external address which may change.

If your ISP provides you with a static address, you could remove the parenthesis from $wan_if.

Last edited by jggimi; 24th February 2015 at 01:42 PM. Reason: clarity, typos
Reply With Quote
  #3   (View Single Post)  
Old 27th February 2015
bharathpaul bharathpaul is offline
New User
 
Join Date: Feb 2015
Posts: 2
Default

Hello,

Thanks for the response. I am stuck into some other stuffs. So I could not test and reply to you now. Don't mind please.

Thanks,
Bharath. P
Reply With Quote
Reply

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
Help with PF NAT configuration scrummie02 OpenBSD Security 12 10th November 2011 04:45 AM
PF NAT configuration help ikevinjpdev OpenBSD Security 0 7th August 2010 04:41 PM
Mouse:X (not-working) and tty-Console (working), in 8.0 ykt FreeBSD General 1 22nd December 2009 12:26 PM
k3b, configuration. maxrussell FreeBSD Ports and Packages 4 3rd March 2009 04:23 AM
Working Configuration for Openbsd 4.0 - Postfix - SASL - TLS roundkat Guides 0 4th May 2008 05:38 PM


All times are GMT. The time now is 11:31 PM.


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