How to add host name with firewall settings

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

How to add host name with firewall settings

Postby galajits@gmail.com » Wed Jun 08, 2022 8:27 am

Hello,

I am using VICIBOX9 VERSION: 2.14-852a, BUILD: 220312-0937. SVN Version:3589 / DB Schema Version:1657

I have enabled IP List in server settings and enabled white list and black list. Now post settings in firewall, all my remote users have to validated there IP address using valid8.php (which I have renamed already) Everything is working like charm without any hackers attacks

With ViciBox, I have integrated some codes which needs to open one web address which is dynamic. I want to understand, where do I put this host name so that Vicidial can access that host name with firewall settings enabled. Currenty when that host name is accessed by callers in vicidial, it throws an error host name is unreachable. The moment I disable the firewall, host name is accessible. Where do I make the entry of this hostname in firewall or in Vicidial so that remote users can access the hostname.

Hostname (http://www.example.com) is basically a external link which I have assigned to WebForm2

Sorry in advance if I have missed out to give any information required.
galajits@gmail.com
 
Posts: 54
Joined: Thu Feb 15, 2018 6:34 am

Re: How to add host name with firewall settings

Postby williamconley » Wed Jun 08, 2022 3:19 pm

1) http://www.example.com/ is not a hostname, it is a URL. "www.example.com" is a hostname.

2) Firewalls only contain IP addresses. If the IP address may change and you want to use DNS to put the IP address in the firewall, you'll need to add that at the command line (daily or at reboot).

3) Example at command line to add a hostname's present IP address to the firewall for FULL access (ie: all ports):

Code: Select all
iptables -A INPUT -s www.example.com -j ACCEPT


However: as previously stated, this will only work until the system reboots or the ip of that hostname changes.

3) Example "crontab -e" entry to add a hostname at boot time:

Code: Select all
@reboot     sleep 60; iptables -A INPUT -s www.example.com -j ACCEPT


Note the sleep 60 will allow plenty of time for the firewall to completely start before attempting to add the new entry. That number could be smaller (or omitted) but for safety we usually just put in the delay. After all, the system IS rebooting so it's not really "in use" at that moment anyway.

4) Example /etc/sysconfig/scripts/SuSEfirewall2-custom method to add each time the firewall restarts:

Code: Select all
nano /etc/sysconfig/scripts/SuSEfirewall2-custom

Find the section for "fw_custom_before_port_handling() {" and put this line above the "true" at the end of that section:

Code: Select all
iptables -A INPUT -s www.example.com -j ACCEPT[


5) Of course, all of this changes in later versions of Vicibox ... so use whichever one works on your system.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: How to add host name with firewall settings

Postby galajits@gmail.com » Tue Jun 28, 2022 7:11 am

Tried iptables -A INPUT -s http://www.example.com -j ACCEPT, but I am still not able to access the host. I get this message, but when dialer tries to access this www.mydomainname.in, it throws the below error of firewall

Warning: mysqli::__construct(): (HY000/2002): No route to host in .......
galajits@gmail.com
 
Posts: 54
Joined: Thu Feb 15, 2018 6:34 am

Re: How to add host name with firewall settings

Postby williamconley » Tue Jun 28, 2022 3:12 pm

galajits@gmail.com wrote:Tried iptables -A INPUT -s http://www.example.com -j ACCEPT, but I am still not able to access the host. I get this message, but when dialer tries to access this http://www.mydomainname.in, it throws the below error of firewall

Warning: mysqli::__construct(): (HY000/2002): No route to host in .......


http://www.example.com/ is not a hostname, it is a URL. "www.example.com" is a hostname.

In case you're still not reading that: REMOVE the "http://" as that is NOT part of the hostname.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 115 guests