All pastes #346354 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-09 09:28 UTC
rendered paste body
# I need pass only traffic between this offices on 80, 1494, 3389 ports
#

# vpn interface to another office with 192.168.130.4 IP address
vpn_if="rl0"
#  internal interface
int_if="rl1"
# tunnel interface (OpenVPN)
ext_if="tun0"

set skip on { lo }

scrub in

antispoof quick for { lo $int_if}
block log all

pass out on $vpn_if inet proto tcp from ($ext_if:0) to 192.168.130.4 port 5000 keep state label "VPN connection"

# passing ping's
pass inet proto icmp all keep state

pass in on $ext_if inet proto tcp from any to ($ext_if) port ssh keep state label "Incoming SSH from another office"
pass in on $int_if inet proto tcp from any to ($int_if) port ssh keep state label "Incoming SSH from Internal"

# Passing out to another office
pass out on $ext_if inet proto tcp from ($int_if:network) to {192.168.1.0/24, 192.168.197.0/24} port {80, 1494, 3389} keep state
pass in on $int_if inet proto tcp from ($int_if:network) to {192.168.1.0/24, 192.168.197.0/24} port {80, 1494, 3389} keep state

# Passing in from another office
pass in on $ext_if inet proto tcp from {192.168.1.0/24, 192.168.197.0/24} to ($int_if:network) port {80, 1494, 3389} keep state
pass out on $int_if inet proto tcp from ($int_if:network) to {192.168.1.0/24, 192.168.197.0/24} port {80, 1494, 3389} keep state