Need help to set up VoIP

Hi community:

I've changed from ISP and my new ISP (O2 Spain) use a VLAN for Internet (ppoe) and other VLAN for VoIP (dhcp), I got internet working right now, but I don't know how to set up the VoIP service.

ONT: Ubiquiti Nano Loco (Profile 2 for a Huaweii OLT)
Router: Linksys WRT3200ACM (DivestedWRT - Master Snapshot kernel 5.15)
VoIP Phone: Grandstream GXP-1620

I've created a br-wan with 3 VLANs, one for Internet (br-wan.6), other for VoIP (br-wan.3) and another for ONT's management, and in the LAN side, I got the br-lan with LAN ports 1-4 with different subnets for different purposes.

For Internet it's easy, with br-wan.6 masqued, all the LAN traffic goes trough this interface (except from the LAN subnet for voip), for ONT's management (masqued too) I can connect from my PC without problems without Internet traffic of course, but I don't know how to route the traffic and / or configure the VoIP from VoIP Phone to the VoIP wan interface to make able to register to my ISP SIP server.

I wnat to make able that my VoIP phone with an IP ( is the LAN subnet for VoIP that I've named it telephony) will be able to register at ISP's SIP's Server using the br-wan.3 (with IP assigned by DHCP) and make calls and receive them.

I don't know if I need that the subnets (br-wan.3 and br-lan.25) have the traffic masqued, only one of them, none of them, or maybe, I need to make the br-wan.3 only at level 2 and make the br-lan.25 (voip phone) the dhcp client.

Can you help me guys?

Thanks in advance

The simplest way would be to move one of the lan ports into br-wan and make it untagged on VLAN 3, so that anything plugged in there (your phone) has a layer 2 bridge to the ONT and gets an IP directly from the ISP.

Policy based routing would be needed to route VoIP packets to the VoIP WAN instead of the regular WAN. It is effectively having two routers in one box.

Thanks for your answer, can you tell me how can I make a policy based routing for VoIP wan to VoIP lan and viceversa?? I need the 4 LAN ports.

Standard practice would still need a separate network for the phone. I suppose you could put the phone in the LAN network with a DHCP reservation then policy route from its IP.

Sorry for the delay to answer you, YES I got a subnet for the local voip because at this moment I'm using only a VoIP Phone (Grandstream GXP 1620) but in a near future when I will able to use the voip service offered by my new ISP, I want to use my Raspberry for a PBX with the VoIP Phone and 2 or 3 old smartphones.

Right now, I got a br-wan.3 for VoIP service (called voip) and br-lan.15 for local VoIP (called telefonia [telephony in english]), and of course, a firewall zone for each one with the same names.

I only use dnsmasq for dhcp leases statically, because I got in the Raspberry, a DNS server with nsd for local DNS, Unbound + Stubby for DoT with pihole working like a charm.

Talking about the firewall, the zone for voip (br-wan.3) has masquerade active (I don't know if this is necessary or not) and the zone telephony (br-lan.15) hasn't masquerade active, one more thing if you need it to know, at 2 OSI level, the br-wan.3 is tagged because I suppose that this is needed.

Need I redirect the 5060 port from br-wan.3 to br-lan.15 and vicecersa?

Can you tell me how to make a route for be able to make use of my ISP's VoIP service, I don't have made this before, it's the first time that I need to use a static route because my prior ISP didn't make use of separate VLAns for each service (Internet and VoIP used the same VLAN).

One more thing, about the priority with VLANs in OpenWrt, how can I set these (for br-wan.3 [voip] and br-wan.6 [internet]) at the network configuration? My router is a Linksys WRT3200ACM which uses the DSA Architecture.

Thanks in advance

I've installed the package "pbr" and luci-app-pbr, I've been reading about Policy Based routing, but I don't understand well how I have to configure the rule for the telephony to voip and or viceversa, I don't know if the rule has to be forward, output or other thing.

Can you tell / explain me how to configure the PBR?

EDIT: A basic guide to be able to use Movistar / O2 (Spanish ISP) VoIP service is here

If I got enough time, skills and you want it, I can write a more detailed guide at the wiki, but my english isn't the best to write guides, sorry mates.

Closed upon users request - new topic with different approach to follow.