Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure an OpenVZ VPS running Debian 6 to run OpenVPN. I've got OpenVPN running, and I can connect to it, but my traffic isn't passing through yet. I get an error when dnsmasq start, and I'm not sure how to resolve it. Here's the error that I get.

dnsmasq: failed to bind listening socket for 10.8.0.1: Address already in use failed!

Here's the output of netstat -ap.

user@lenwood:/usr# netstat -ap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:microsoft-ds          *:*                     LISTEN      1341/smbd       
tcp        0      0 localhost:submission    *:*                     LISTEN      1459/sendmail: MTA:
tcp        0      0 *:netbios-ssn           *:*                     LISTEN      1341/smbd       
tcp        0      0 *:www                   *:*                     LISTEN      1401/apache2    
tcp        0      0 10.8.0.1:domain         *:*                     LISTEN      1381/named      
tcp        0      0 lenwood.com:domain       *:*                     LISTEN      1381/named      
tcp        0      0 127.0.0.2:domain        *:*                     LISTEN      1381/named      
tcp        0      0 localhost:domain        *:*                     LISTEN      1381/named      
tcp        0      0 *:ssh                   *:*                     LISTEN      1476/sshd       
tcp        0      0 localhost:smtp          *:*                     LISTEN      1459/sendmail: MTA:
tcp        0      0 localhost:953           *:*                     LISTEN      1381/named      
tcp        0    240 lenwood.com:ssh          cpe-64-68-125-178:54763 ESTABLISHED 5316/0          
tcp6       0      0 [::]:domain             [::]:*                  LISTEN      1381/named      
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      1476/sshd       
tcp6       0      0 localhost:953           [::]:*                  LISTEN      1381/named      
udp        0      0 10.8.0.1:domain         *:*                                 1381/named      
udp        0      0 lenwood.com:domain       *:*                                 1381/named      
udp        0      0 127.0.0.2:domain        *:*                                 1381/named      
udp        0      0 localhost:domain        *:*                                 1381/named      
udp        0      0 lenwood.com:netbios-ns   *:*                                 1337/nmbd       
udp        0      0 lenwood.com:netbios-ns   *:*                                 1337/nmbd       
udp        0      0 127.0.0.2:netbios-ns    *:*                                 1337/nmbd       
udp        0      0 127.0.0.2:netbios-ns    *:*                                 1337/nmbd       
udp        0      0 *:netbios-ns            *:*                                 1337/nmbd       
udp        0      0 lenwood.com:netbios-dgm  *:*                                 1337/nmbd       
udp        0      0 lenwood.com:netbios-dgm  *:*                                 1337/nmbd       
udp        0      0 127.0.0.2:netbios-dgm   *:*                                 1337/nmbd       
udp        0      0 127.0.0.2:netbios-dgm   *:*                                 1337/nmbd       
udp        0      0 *:netbios-dgm           *:*                                 1337/nmbd       
udp        0      0 *:openvpn               *:*                                 3369/openvpn    
udp6       0      0 [::]:domain             [::]:*                              1381/named      
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     1408905812 1361/saslauthd      /var/run/saslauthd/mux
unix  6      [ ]         DGRAM                    1408905918 1369/syslogd        /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     1408907150 1459/sendmail: MTA: /var/run/sendmail/mta/smcontrol
unix  2      [ ]         DGRAM                    1436674630 5316/0              
unix  2      [ ]         DGRAM                    1408908858 1488/xinetd         
unix  2      [ ]         DGRAM                    1408907081 1459/sendmail: MTA: 
unix  2      [ ]         DGRAM                    1408906063 1381/named          

Can anyone point me in the right direction? Thanks in advance.

share|improve this question

migrated from stackoverflow.com Apr 17 '12 at 14:25

This question came from our site for professional and enthusiast programmers.

    
What do you mean by "traffic isn't passing through yet"? Can you ping 10.8.0.1 from a connected VPN client? If not it's probably a firewall issue. Posting the output of iptables -nvL would help to debug that. –  mgorven Apr 17 '12 at 19:14
add comment

2 Answers

up vote 1 down vote accepted
tcp        0      0 10.8.0.1:domain         *:*                     LISTEN      1381/named

It looks like bind is listening on that socket, which is why dnsmasq can't start. You need to configure bind to only listen on specific IP addresses, with something like the following in named.conf:

listen-on { 50.56.53.125; };
share|improve this answer
    
This solved it. Thank you! I set the listen-on option to listen to the external IP address, now everything works. Is it any kind of security risk for BIND to be listening to an external IP address? –  Lenwood Apr 18 '12 at 0:15
1  
BIND was listening on all addresses before, so it's more restrictive. Unless you don't want BIND to be externally accessible (i.e. you're only using it internally) you need it to listen on the external IP. –  mgorven Apr 18 '12 at 0:28
    
Excellent. Thanks again. –  Lenwood Apr 18 '12 at 2:29
add comment

What's the network scheme and configs?

If traffic won't route via tunnel, you surely won't get DNS answers (or whatever traffic you need).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.