[ASTPPCOM-545] Fresh Install ASTPP will randomly bind ipv6 over ipv4 on restart Created: 19/Aug/19  Updated: 24/May/20  Resolved: 27/Sep/19

Status: Done
Project: ASTPP Community
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task
Reporter: redbehrend Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

So I found out last night with a fresh install of ASTPP 4.0.1 that freeswitch will randomly bind to ipv6 over ipv4 which stops everything from working. If you keep restarting it will randomly select ipv4 on next reboot or a couple in.
I know this is how ASTPP is configured with freeswitch as we have 5 other freeswitch pbx / billing brands on the exact same VM which don't have this issue.

Nothing was changed outside of the default ASTPP setup.



 Comments   
Comment by Samir Doshi [ 28/Aug/19 ]

Hi [~Redbehrend]

That is strange. Please provide the following information:

1. You sip profile settings
2. ifconfig output
3. freeswitch's sofia status output.

Comment by redbehrend [ 19/Sep/19 ]

Sorry didn't see the alert on my github here it's all defaults except for the gateway
What happens is ASTPP says everything is running fine but only responds to IPV6 after restarting it a couple times IPV4 randomly gets selected.

SIP Profiles are default by ASTPP
The crucial part of it is SIP IP = $${local_ip_v4} and PORT = 5060

ifconfig output
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet XXX.XXX.XXX.XXX netmask 255.255.254.0 broadcast XXX.XXX.XXX.XXXX
inet6 XXXX::XXXX:XXX:XXXX:XXXX prefixlen 64 scopeid 0x20<link>
inet6 XXXX::XXXX:XXX:XXXX:XXXX prefixlen 64 scopeid 0x0<global>
ether XXXX::XXXX:XXX:XXXX:XXXX txqueuelen 1000 (Ethernet)
RX packets 51490762 bytes 11173124362 (10.4 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 51755182 bytes 11030503652 (10.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 6777202 bytes 5778691749 (5.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6777202 bytes 5778691749 (5.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

sofia status output

default profile sip:mod_sofia@XXX.XXX.XXX.XXX:5060 RUNNING (0)
default::gw_voip_term gateway sip:FreeSWITCH@XXX.XXX.XXX.XXX NOREG

Comment by redbehrend [ 27/Sep/19 ]

Checking this out more it's deff something with your guys config or maybe your version of freeswitch you are using has a bug.
So with my other ipv4/ipv6 freeswitches the $${local_ip_v4} in the profile works fine.
With ASTPP that profile will use a ipv6 if it's available which causes profiles to not connect internally even though they show connected in ASTPP maybe because it's using it for LAN and WAN? not sure never shared port 5060 like you guys do. If you disable ipv6 even just on wan fs_cli breaks in CLI based on your settings. So using the profile variable $${local_ip_v4} in sofia profiles breaks the config at least on my two test systems when ipv6 is enabled and you reboot because it partly binds to ipv6.

With other freeswitch opensource projects and default freeswitch if you disable ipv6 on WAN it's fine and LAN/CLI still works. Not sure if it's sharing the ports or configs in ASTPP but you have a ipv6 auto or :: somewhere that tries to use ipv6.

Notes: Maybe you have hard coded in the adapter names or positions instead of searching correctly when binding or during setup? So if a system has more than 1 adapter it doesn't setup right to ipv4? Not sure without looking into it more just shooting in the dark. Seems when a system doesn't name the first adapter eth1 I get errors during setup also but no idea if they are related like when I use virtual systems that name them things like ens1, vns1, etc...

Comment by Devang Nathwani [ 24/May/20 ]

Hello,

In fs_cli, if you execute

eval $${local_ip_v4}

You should get ipv4.
If there is anything wrong for picking the IP by FreeSWITCH, you may overwrite the value of local_ip_v4 variable in varx.xml file of FreeSWITCH config.

Thanks.

Generated at Sat Feb 10 07:18:08 CET 2024 using Jira 8.13.3#813003-sha1:22ebedbb75c99b147c66f14e031dd8a2d214753a.