Anyway, as the PI is connected to a trunk port and I am having issues to get the juice flowing .. As soon as I create additional VLAN interfaces I am unable to route at all ..
I am coming from a different distro (RedHat) so please bear with me

It seems that the gateway is always configured on eth0 and it seems that eth0 always have to be untagged ..
As a result I got three interfaces now
$this->bbcode_second_pass_code('', 'eth0 : 192.168.13.0/24
eth0.10: 192.168.13.0/24
eth0.20: 192.168.2.0/24')
The way I configured this is
$this->bbcode_second_pass_code('', 'iptables -t nat -A POSTROUTING -o eth0.10 -j MASQUERADE
iptables -A FORWARD -i eth0.10 -o eth0.20 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0.20 -o eth0.10 -j ACCEPT')
added an additional static route (gw is 192.168.13.254) to no avail
$this->bbcode_second_pass_code('', '[root@firewall ~]# ip route show
default via 192.168.13.254 dev eth0.1
default via 192.168.13.254 dev eth0
192.168.2.0/24 dev eth0.2 proto kernel scope link src 192.168.2.1
192.168.13.0/24 dev eth0 proto kernel scope link src 192.168.13.250
192.168.13.0/24 dev eth0.1 proto kernel scope link src 192.168.13.1')
I tried to simply configure rc.conf this way
$this->bbcode_second_pass_code('', '
interface=eth0.10
address=192.168.13.250
netmask=255.255.255.0
broadcast=192.168.13.255
gateway=192.168.13.254
')
But it doesn 't seem to work at all.
I probably get the complete wrong end of the stick here so any tips are appreciated -