Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Telekom VOIP IPs - Fritz Box accesslist
<?php
$chars = [
'b',
'd',
'f',
'h',
'k',
'l',
'm',
'n',
's',
];
$domains = [
'%s-ipu-a%s.isp.t-ipnet.de',
'%s-ipp-a%s.isp.t-ipnet.de',
];
$numbers = [
'01',
'02',
];
$voipAccessList = <<<EOF
accesslist = "reject udp any any eq 5060",
"reject udp any any eq 5070",
"reject udp any any eq 5080",
"reject udp any any eq 3478",
"reject udp any any eq 3479",
"reject udp any any eq 8089",
"reject tcp any any eq 8089",
"reject udp any any range 7078 7109",
"reject udp any any range 30000 31000",
"reject udp any any range 40000 41000",
EOF;
foreach ($domains as $domain) {
foreach ($chars as $char) {
foreach ($numbers as $number) {
$voipAccessList .= ' "reject ip any ' . gethostbyname(sprintf($domain, $char, $number)) . ' 255.255.255.255",' . PHP_EOL;
}
}
}
$voipAccessList .= ' "permit ip any any";' . PHP_EOL;
echo $voipAccessList;
@sandrokeil

This comment has been minimized.

Copy link
Owner Author

sandrokeil commented Aug 23, 2018

You will get something like this

accesslist = "reject udp any any eq 5060",
             "reject udp any any eq 5070",
             "reject udp any any eq 5080",
             "reject udp any any eq 3478",
             "reject udp any any eq 3479",
             "reject udp any any eq 8089",
             "reject tcp any any eq 8089",
             "reject udp any any range 7078 7109",
             "reject udp any any range 30000 31000",
             "reject udp any any range 40000 41000",
             "reject ip any 217.0.19.218 255.255.255.255",
             "reject ip any 217.0.19.214 255.255.255.255",
             "reject ip any 217.0.16.218 255.255.255.255",
             "reject ip any 217.0.16.214 255.255.255.255",
             "reject ip any 217.0.16.154 255.255.255.255",
             "reject ip any 217.0.16.150 255.255.255.255",
             "reject ip any 217.0.16.90 255.255.255.255",
             "reject ip any 217.0.16.86 255.255.255.255",
             "reject ip any 217.0.20.90 255.255.255.255",
             "reject ip any 217.0.20.86 255.255.255.255",
             "reject ip any 217.0.17.218 255.255.255.255",
             "reject ip any 217.0.17.214 255.255.255.255",
             "reject ip any 217.0.16.26 255.255.255.255",
             "reject ip any 217.0.16.22 255.255.255.255",
             "reject ip any 217.0.20.154 255.255.255.255",
             "reject ip any 217.0.20.150 255.255.255.255",
             "reject ip any 217.0.17.26 255.255.255.255",
             "reject ip any 217.0.17.22 255.255.255.255",
             "reject ip any 217.0.19.230 255.255.255.255",
             "reject ip any 217.0.19.227 255.255.255.255",
             "reject ip any 217.0.16.234 255.255.255.255",
             "reject ip any 217.0.16.231 255.255.255.255",
             "reject ip any 217.0.16.170 255.255.255.255",
             "reject ip any 217.0.16.167 255.255.255.255",
             "reject ip any 217.0.16.106 255.255.255.255",
             "reject ip any 217.0.16.103 255.255.255.255",
             "reject ip any 217.0.20.102 255.255.255.255",
             "reject ip any 217.0.20.99 255.255.255.255",
             "reject ip any 217.0.17.230 255.255.255.255",
             "reject ip any 217.0.17.227 255.255.255.255",
             "reject ip any 217.0.16.42 255.255.255.255",
             "reject ip any 217.0.16.39 255.255.255.255",
             "reject ip any 217.0.20.166 255.255.255.255",
             "reject ip any 217.0.20.163 255.255.255.255",
             "reject ip any 217.0.17.42 255.255.255.255",
             "reject ip any 217.0.17.39 255.255.255.255",
             "permit ip any any";

@sandrokeil

This comment has been minimized.

Copy link
Owner Author

sandrokeil commented Aug 23, 2018

It's not enough, simply use this accesslist. Then it works 🎉

		accesslist = "reject udp any any eq 53",
			     "reject udp any any eq 5060",
			     "reject udp any any eq 5070",
			     "reject udp any any eq 5080",
			     "reject udp any any eq 3478",
			     "reject udp any any eq 3479",
			     "reject udp any any eq 8089",
			     "reject tcp any any eq 8089",
			     "reject udp any any range 7078 7109",
			     "reject udp any any range 30000 31000",
			     "reject udp any any range 40000 41000",
			     "reject ip any 217.0.0.0 255.255.0.0",
			     "permit ip any any";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.