Hallo @all,
I'm new to this forum and I have a question about building a network bridge to shape traffic. My system is a FreeBSD 10 machine with two network cards and I will use this system in front of my firewall to shape the traffic in and out. First some Information about my configuration:
rc.conf
/etc/sysctl.conf
/etc/rc.firewall
Some more Information: My client is connected to theif interface re1 and the firewall is connected on if interface re0.
Now the problem: So this is the example with I do my tests. I will first shape the traffic that is using port for RDP (TCP/3389). When I enable the following lines:
I can't established the traffic through the bridge, when I disable the lines and reload the firewall script it is working without any interruption. I see by typing
On my Client I see a SYN_SENT that's all. Does anybody know what is wrong in my configuration?
I test and search for the last three day for a solution and I hope anybody can help :e
Thanks a lot and I hope this is the right forum.
Arne Tiedemann alias Kringson
I'm new to this forum and I have a question about building a network bridge to shape traffic. My system is a FreeBSD 10 machine with two network cards and I will use this system in front of my firewall to shape the traffic in and out. First some Information about my configuration:
rc.conf
Code:
# Firewall
firewall_enable="Yes"
firewall_type="/etc/rc.firewall"
firewall_logging="YES"
# Network konfig
cloned_interfaces="bridge0"
ifconfig_bridge0="addm re0 stp re0 addm re1 stp re1 up"
# DHCP configuration
ifconfig_re0="dhcp"
ifconfig_re1="dhcp"
/etc/sysctl.conf
Code:
# Bridging options
# source http://www.freebsd.org/cgi/man.cgi?query=if_bridge&sektion=4&apropos=0&manpath=FreeBSD+10.0-RELEASE
#net.inet.ip.fw.enable=1
#net.link.ether.ipfw=1
net.link.bridge.ipfw=1
net.link.bridge.ipfw_arp=0
net.link.bridge.pfil_member=1
net.link.bridge.pfil_local_phys=1
net.link.bridge.log_stp=1
/etc/rc.firewall
Code:
#!/bin/sh
#firewall command
fwcmd="/sbin/ipfw -q"
#interfaces
IntLAN=re1
IntFW=re0
ks="keep-state" # just too lazy to key this each time
sks="setup keep-state"
fw="skipto 5000" # Means that Firewall rules are starting from number 5000
cs="skipto 3000"
# Force a flushing of the current rules before we reload.
$fwcmd -f flush
################################################################################
# Setup all Internet connections here
#
# download pipes are always have a null at the end
# upload pipes are always have a five at the end
#
################################################################################
# configuration for 16Mbit/s
$fwcmd pipe 10 config bw 8Mbit/s # High
$fwcmd pipe 20 config bw 6Mbit/s # Medium
$fwcmd pipe 30 config bw 2Mbit/s # Low
$fwcmd pipe 100 config delay 200 # Delay for test ICMP
################################################################################
# add queues
################################################################################
# high performance
$fwcmd queue 10 config pipe 10 weight 90 # High with high weight
# medium performance
$fwcmd queue 20 config pipe 20 weight 60 # Medium with medium weight
# low performance
$fwcmd queue 30 config pipe 30 weight 40 # Meduim with medium weight
################################################################################
# classify the traffic
# high priority class
################################################################################
########################## high priority class #################################
$fwcmd add 01000 queue 10 ip from any to any out via ${IntFW} tcpflags ack iplen 52
$fwcmd add 01010 ${fw} ip from any to any out via ${IntFW} tcpflags ack iplen 52
# Remote Desktop's
$fwcmd add 01100 queue 10 tcp from any to any 3389 in via ${IntLAN}
$fwcmd add 01110 ${fw} tcp from any to any 3389 in via ${IntLAN} ${sks}
$fwcmd add 01120 queue 10 udp from any 3389 to any in via ${IntFW}
$fwcmd add 01130 ${fw} udp from any 3389 to any in via ${IntFW} ${ks}
$fwcmd add 01140 queue 30 tcp from any to any 3389 in via ${IntFW}
$fwcmd add 01150 ${fw} tcp from any to any 3389 in via ${IntFW} ${sks}
$fwcmd add 01160 queue 30 udp from any 3389 to any in via ${IntLAN}
$fwcmd add 01170 ${fw} udp from any 3389 to any in via ${IntLAN} ${ks}
#######################################################################################
# firewall rules
#######################################################################################
$fwcmd add 05000 check-state
$fwcmd add 05010 deny all from any to any frag
################################################################################
# some default rules
################################################################################
$fwcmd add 05100 allow tcp from any to me 22 ${sks}
Some more Information: My client is connected to the
Now the problem: So this is the example with I do my tests. I will first shape the traffic that is using port for RDP (TCP/3389). When I enable the following lines:
Code:
$fwcmd add 01100 queue 10 tcp from any to any 3389 in via ${IntLAN}
$fwcmd add 01110 ${fw} tcp from any to any 3389 in via ${IntLAN} ${sks}
I can't established the traffic through the bridge, when I disable the lines and reload the firewall script it is working without any interruption. I see by typing
ipfw -t list that the rules and the queue are match but now traffic will go through the machine.
Code:
root@ps01:~ # ipfw -t list
01000 queue 10 ip from any to any out via re0 tcpflags ack iplen 52
01010 skipto 5000 ip from any to any out via re0 tcpflags ack iplen 52
01100 Tue Feb 18 14:16:12 2014 queue 10 tcp from any to any dst-port 3389 in via re1
01110 skipto 5000 tcp from any to any dst-port 3389 in via re1 setup keep-state
01120 Tue Feb 18 14:16:15 2014 queue 10 udp from any 3389 to any in via re0
01130 skipto 5000 udp from any 3389 to any in via re0 keep-state
01140 queue 30 tcp from any to any dst-port 3389 in via re0
01150 skipto 5000 tcp from any to any dst-port 3389 in via re0 setup keep-state
01160 queue 30 udp from any 3389 to any in via re1
01170 skipto 5000 udp from any 3389 to any in via re1 keep-state
05000 check-state
05010 deny ip from any to any frag
05100 allow tcp from any to me dst-port 22 setup keep-state
05120 Tue Feb 18 14:16:16 2014 allow tcp from any to any established
10000 Tue Feb 18 14:16:15 2014 allow log ip from any to any keep-state
65535 Tue Feb 18 13:28:45 2014 deny ip from any to any
On my Client I see a SYN_SENT that's all. Does anybody know what is wrong in my configuration?
I test and search for the last three day for a solution and I hope anybody can help :e
Thanks a lot and I hope this is the right forum.
Arne Tiedemann alias Kringson