On my Asterisk server, I happen to have two on-board ethernet boards. Since I only used one of these, I decided to move my VoIP phone from the local network switch to being connected directly to the Asterisk server.

The main advantage is that this phone, running proprietary software of unknown quality, is no longer available on my general home network. Most importantly though, it no longer has access to the Internet, without my having to firewall it manually.

Here's how I configured everything.

Private network configuration

On the server, I started by giving the second network interface a static IP address in /etc/network/interfaces:

auto eth1
iface eth1 inet static

On the VoIP phone itself, I set the static IP address to and the DNS server to I then updated the SIP registrar IP address to

The DNS server actually refers to an unbound daemon running on the Asterisk server. The only configuration change I had to make was to listen on the second interface and allow the VoIP phone in:

    access-control: refuse
    access-control: allow
    access-control: allow

Finally, I opened the right ports on the server's firewall in /etc/network/iptables.up.rules:

-A INPUT -s -p udp --dport 5060 -j ACCEPT
-A INPUT -s -p tcp --dport 5060 -j ACCEPT
-A INPUT -s -p udp --dport 10000:20000 -j ACCEPT

Network time synchronization

In order for the phone to update its clock automatically using NTP, I installed chrony on the Asterisk server:

apt install chrony

then I configured it to listen on the private network interface and allow access from the VoIP phone by adding the following to /etc/chrony/conf.d/asterisk-local.conf:


Finally, I opened the right firewall port by adding a new rule to /etc/network/iptables.up.rules:

-A INPUT -s -p udp --dport 123 -j ACCEPT

Accessing the admin page

Now that the VoIP phone is no longer available on the local network, it's not possible to access its admin page. That's a good thing from a security point of view, but it's somewhat inconvenient.

Therefore I put the following in my ~/.ssh/config to make the admin page available on http://localhost:8081 after I connect to the Asterisk server via ssh:

Host asterisk
    LocalForward localhost:8081

Allowing calls between local SIP devices

Because this local device is not connected to the local network (, it's unable to negotiate a direct media connection to any other local (i.e. one connected to the same Asterisk server) SIP device. What this means is that while calls might get connected successfully, by default, there will not be any audio in a call.

In order for the two local SIP devices to be able to hear one another, we must enforce that all media be routed via Asterisk instead of going directly from one device to the other. This can be done using the directmedia directive (formerly canreinvite) in sip.conf:


where 1234 is the extension of the phone.