LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-07-2009, 10:12 PM   #1
taske
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Rep: Reputation: 0
dnsmasq: failed to bind DHCP server socket: Address already in use


Hi everyone

i have problem with dnsmasq and dhcp. I cant get dhcp working.

[root@test diplomska]# dnsmasq --log-dhcp
dnsmasq: failed to bind DHCP server socket: Address already in use

This is the setup

[root@test diplomska]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:13:8F:BC:01:30
inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15242 errors:0 dropped:0 overruns:0 frame:0
TX packets:15444 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13826515 (13.1 MiB) TX bytes:2387616 (2.2 MiB)
Interrupt:22 Base address:0xa800

eth1 Link encap:Ethernet HWaddr 00:C0F:EE:B5:79
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7866 (7.6 KiB) TX bytes:7476 (7.3 KiB)
Interrupt:22 Base address:0xbc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12119 errors:0 dropped:0 overruns:0 frame:0
TX packets:12119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:512240 (500.2 KiB) TX bytes:512240 (500.2 KiB)


#############
# INTERFACES#
#############

# Networking Interface
DEVICE=eth0
BOOTPROTO=dhcp
NAME="WAN"
HWADDR=00:13:8F:BC:01:30
ONBOOT=yes
TYPE=Ethernet
PEERDNS=yes
PEERROUTES=yes
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03

# Networking Interface
DEVICE=eth1
BOOTPROTO=none
IPADDR=192.168.3.1
NETMASK=255.255.255.0
NETWORK=192.168.3.0
BROADCAST=192.168.3.255
NAME="LAN"
HWADDR=00:C0F:EE:B5:79
ONBOOT=yes
TYPE=Ethernet
PREFIX=24
#PEERDNS=yes
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04

##############
# /etc/hosts #
##############

127.0.0.1 test.router localhost.localdomain localhost
192.168.3.1 router


####################
# /etc/resolv.conf #
####################

nameserver 127.0.0.1

#######################
# /etc/resolv.dnsmasq #
#######################

nameserver 192.168.1.1

#####################
# /etc/dnsmasq.conf #
#####################

domain-needed
bogus-priv
resolv-file=/etc/resolv.dnsmasq
interface=eth1
listen-address=127.0.0.1
listen-address=192.168.3.1
bind-interfaces
expand-hosts
dhcp-range=192.168.3.100,192.168.3.150,12h
log-queries
log-dhcp

#######
# NAT #
#######

iptables -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
service iptables restart

#############################
# output od tcpdump -i eth1 #
#############################

02:45:08.290027 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1e:ec:9a:57:93 (oui Unknown), length 300
02:45:15.048943 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1e:ec:9a:57:93 (oui Unknown), length 300
02:45:36.063862 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1e:ec:9a:57:93 (oui Unknown), length 300

i can ping eth1
 
Old 11-08-2009, 06:34 PM   #2
taske
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Original Poster
Rep: Reputation: 0
I think i've found the problem. Interface eth1 should not have an IP address. Don't know why i address that iface in a first place .. i am so dumb .. hihihi

Cheers
 
Old 11-08-2009, 06:40 PM   #3
taske
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Actually the output from dnsmasq --log-dhcp is still same.. failed to bind DHCP bla bla bla.. but now is working )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unix-socket error:bind: Address already in use sweetytweety Linux - Newbie 2 05-12-2008 02:13 AM
can not bind socket to address terrormaniak Linux - Server 1 09-14-2007 02:16 PM
can not bind socket to address terrormaniak Linux - Software 0 09-12-2007 04:00 PM
cannot bind to socket: address already in use exfacior Linux - Wireless Networking 0 09-27-2004 01:34 PM
Help me with this socket address bind program. rnice Linux - Networking 0 09-17-2004 08:33 PM


All times are GMT -5. The time now is 08:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration