Ive got
eth0:0 192.168.2.10 (for bgp network announce, no vlan, alias on eth0)
eth0.1 192.168.3.20 (for bgp session 1,vlan3 transport to bgp router)
eth0.2 192.168.4.30 (for bgp session 2,vlan4 transport to bgp router)
default route is given by zebra (192.168.3.1 or 192.168.4.1 -- failover)
when external ip (192.168.1.100) tries to connect to 192.168.2.10 -> answered packets goes via 192.168.3.1 (where source ip for this is 192.168.3.20). This works correct. But i want source address to be 192.168.2.10. Main problem is when asterisk is running on 192.168.2.10 and clients try to register sip from 192.168.1.100 -> answers are send from 192.168.3.20 and packages are dropped on remote side .
How to fix/solve this? or is there any other way of configuration interfaces? Main idea is to switch routing for 192.168.2.10 if one of bgp sessions goes down.
rp_filter=0 on all interfaces
If i put something like:
iptables -t nat -A POSTROUTING -d 192.168.1.0/24 -j SNAT --to-source 192.168.5.58
this doesn't work either.
All the problem is that asterisk is behind nat in this scheme. if i run it on all interfaces -> sip client connects ok on 192.168.4.30 and 192.168.3.20 ip's , but not on 192.168.2.10 one.