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 30th September 2016
bsdsource bsdsource is offline
Port Guard
 
Join Date: Apr 2014
Posts: 34
Default network address translation

I have an xbox and a ps4 that both need static ports (outbound). The following code works fine for just my xbox:

Code:
xbox = "192.168.1.111"
ps4 =  "192.168.1.112"

# Perform source-port randomization for all hosts which are not the xbox
match out log on egress from !$xbox to any nat-to ($ext_if:0) port 1024:65535

# Do not perform source-port randomization for the xbox
match out log on egress from $xbox to any nat-to ($ext_if:0) static-port
I attempted to add my ps4 but it doesn't appear to be working as intended. Here is the code:

Code:
xbox = "192.168.1.111"
ps4 =  "192.168.1.112"

# Perform source-port randomization for all hosts which are not the xbox
match out log on egress from !$xbox to any nat-to ($ext_if:0) port 1024:65535

# Do not perform source-port randomization for the xbox or ps4
match out log on egress from $xbox to any nat-to ($ext_if:0) static-port
match out log on egress from $ps4 to any nat-to ($ext_if:0) static-port
The first match rule not equal to the xbox (!$xbox) I have a question about. Is it possible to add the ps4 to that same line as an "or" statement? Something similar to:

Code:
match out log on egress from {!$xbox || !$ps4} to any nat-to ($ext_if:0) port 1024:65535
If I'm going all wrong with this code can someone provide a solution or suggestion? Thank you.
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
PF and NAT: Specify SRC IP Address? jasonvp FreeBSD Security 5 25th November 2015 08:04 PM
Address book fossala Programming 6 5th July 2011 05:26 PM
could not look up internet address for .lan idefix FreeBSD General 2 31st January 2009 02:22 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 04:29 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