Hey Wodin thanks for the help,
port 4 will have an old 802.11b router, setup as a switch only (DHCP turned off). so guests can logon wired/wirelessly to the net without having access to the other 2 vlans.
while reading up on the link you posted, I managed to find a tutorial on setting up DMZ, I figured I can start there, and then add another vlan, once I got the first step working.
I'm glad I got the first step working, but still having trouble getting 3 vlans working.
here is what I have so far:
/etc/config/network
#### VLAN configuration
config switch eth0
option vlan0 "2 3 5*" # private lan
option vlan1 "0 5" # wan
option vlan2 "4 5" # DMZ
option vlan3 "1 5" # public lan
#### Loopback configuration
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0.0"
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
#### WAN configuration DHCP
config interface wan
option ifname "eth0.1"
option proto "dhcp"
option hostname "kamikaze"
### DMZ configuration
config interface dmz
option ifname "eth0.2"
option proto static
option ipaddr 192.168.2.1
option netmask 255.255.255.0
### Public lan configuration
config interface pub
option ifname "eth0.3"
option proto static
option ipaddr 192.168.3.1
option netmas 255.255.255.0
/etc/config/dhcp
config dhcp
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp
option interface wan
option ignore 1
config dhcp
option interface dmz
option start 100
option limit 150
option leasetime 12H
config dhcp
option interface pub
option start 100
option limit 150
option leasetime 12H
/etc/firewall.user
!/bin/sh
# Copyright (C) 2006 OpenWrt.org
iptables -F input_rule
iptables -F output_rule
iptables -F forwarding_rule
iptables -t nat -F prerouting_rule
iptables -t nat -F postrouting_rule
# The following chains are for traffic directed at the IP of the
# WAN interface
iptables -F input_wan
iptables -F forwarding_wan
iptables -t nat -F prerouting_wan
# Get DMZ interface
[ -z "$DMZ" ] && config_get DMZ dmz ifname
# Allow DMZ->WAN
[ -n "$DMZ" -a -n "$WAN" ] &&
iptables -A forwarding_rule -i $DMZ -o $WAN -j ACCEPT
# Allow LAN->DMZ
[ -n "$LAN" -a -n "$DMZ" ] &&
iptables -A forwarding_rule -i $LAN -o $DMZ -j ACCEPT
# Get Public interface
[ -z "$PUB" ] && config_get PUB pub ifname
# Allow PUB->WAN
[ -n "$PUB" -a -n "$WAN" ] &&
iptables -A forwarding_rule -i $PUB -o $WAN -j ACCEPT
so the above configuration, when connected to port 2 or 3, I'm able to get a 192.168.1.x address through DHCP , and when connected to port 4, I get a 192.168.2.1 address... perfect!!
1. I can access the net from both vlans.
2. I can ping from 192.168.1.x => 192.168.2.x so from private to public
3. I can't ping from 192.168.2.x => 192.168.1.x ... great the public network can't access my private subnet.
the trouble now is my last vlan 192.168.3.1 doesnt work (port 1), I don't get an automatically 192.168.3.x assigned IP, and even when I set it manually, I can't ping anything.
any ideas?
thanks again.