LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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-19-2009, 05:42 PM   #1
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Rep: Reputation: 31
Question [SOLVED] dnsmasq as dhcp server on eth0 and networkmanager [SOLVED]


i use fedora as a server and want it to use as router.
herefor i need dnsmasq to set up an dhcp server
and /etc/init.d/dnsmasq restart says OK.

my dnsmasq.conf looks like
Code:
domain-needed
bogus-priv
resolv-file=/etc/resolv.conf
dhcp-range=192.168.2.100,192.168.2.250,255.255.255.0,12h
dhcp-option=3,192.168.2.1
dhcp-option=15,dhcp.server.lan
#listen-address=192.168.2.1
interface=eth0
except-interface=wlan0
except-interface=wlan1
bind-interfaces
Code:
sudo /etc/init.d/dnsmasq restart
Starting dnsmasq   [  OK  ]
so far so good

it shoud act as a dhcp only my first question is that my dnsserver is at 192.168.1.1 does it get thisone from resolv.conf than i have it configured correctly for that.
i dont now how to forward thatone.
but

i still have NetworkManager running up eth0 and wlan for wlan connection

howto send out dhcp dnsmasq to eth0
eth0 is still listening to dhcp and it should send dhcp????
howto configure thisone?

thanks in advanced

Last edited by R03L; 12-02-2009 at 05:43 AM.
 
Old 11-21-2009, 10:20 AM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
I'm not quite sure that I'm reading this correctly; let's start from the top:

I'm going to call the fedora box with dnsmasq running 'dhcp server'.
  • what interfaces are available on dhcp server?
  • what are the ip addresses on each interface?
  • what device has a connection to the internet?
  • what device is sharing network connections (router, switch, hub...)
  • what other computers do you have on your network?
  • what are their IP addresses?
  • Where were these machines getting IP address before you set up dnsmasq?
  • have you done a release/renew on their IP addresses since you installed dnsmasq?

If you can answer these, as well as any other special setup on your network, I'll be in a better position to help.
 
Old 11-23-2009, 05:43 AM   #3
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
Question

i have a fileserver wireless connected whit my dd-wrt router.
and i have my dekstop pc besides that.
i cannot have my fileserver below becouse the people living here dont allow that, yes i need to move from a room to a house but enough of that..

i have a wireless connection to my fileserver
and want a wired connection to my desktop from the fileserver.

now i have connection sharing enabled on the fileserver and that works but i want to use dnsmasq to do it.

from fileserver one router wireless,
one desktop pc 1000mb wired. need an ip adress from dhcpserver.

dhcpd or dnsmasq but my m8 said i best can use dnsmasq to do this.

now you see i have dnsmasq running.
but i don't get any ip adress from this,

like i said i still have eth0 1000mb wired at dhcp client, asking for dhcp from my desktop and i can use internet connection sharing to do this,
but i get a range of 10.42.43.* i want it to have a range of 192.168.2.*
and than my router dd-wrt gives me 192.168.1.*
 
Old 11-26-2009, 07:56 PM   #4
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by R03L View Post
i have a fileserver wireless connected whit my dd-wrt router.
and i have my dekstop pc besides that.
i cannot have my fileserver below becouse the people living here dont allow that, yes i need to move from a room to a house but enough of that..

i have a wireless connection to my fileserver
and want a wired connection to my desktop from the fileserver.

now i have connection sharing enabled on the fileserver and that works but i want to use dnsmasq to do it.

from fileserver one router wireless,
one desktop pc 1000mb wired. need an ip adress from dhcpserver.

dhcpd or dnsmasq but my m8 said i best can use dnsmasq to do this.

now you see i have dnsmasq running.
but i don't get any ip adress from this,

like i said i still have eth0 1000mb wired at dhcp client, asking for dhcp from my desktop and i can use internet connection sharing to do this,
but i get a range of 10.42.43.* i want it to have a range of 192.168.2.*
and than my router dd-wrt gives me 192.168.1.*
[Note that R03L and I had a short conversation off line, who sent me a picture of his network configuration, which I've rendered as the attached PDF].

http://e1h13.simplecdn.net/lqcdn/ima...attach/pdf.gif

So... here's how I'm reading this:

  • Internet connection on DD-WRT, with LAN interface at 192.169.1.1
  • Wireless connection between DD-WRT and Computer 2 (Fedora 12 router/File server). Computer 2 wireless connection at 192.168.1.100
  • 1000mb ethernet connection between Computer 2 and Computer 1 (Desktop Fedora 12).
  • Computer 2 currently does connection sharing, it serves a 10.42.43.* address via dhcp.
  • The desire is to have connection sharing between Computer 2 and Computer 1 with the ethernet interface on Computer 2 at 192.168.2.1, and ethernet interface on Computer 1 at 192.168.2.100.

The wlan connection on Computer 2 seems to be correct.

Undo any firewall/routing settings that you have set up for connection sharing on Computer 2.

Set eth0 on Computer 2 with a static IP address of 192.168.2.1

Your dnsmasq.conf looks ok (it's actually configured better than mine).

Once you've set the static IP address on eth0, release and renew your IP address on Computer 1. It should get an IP address of 192.168.2.100.

After you have done this, you can set up IP Masquerading (which is what internet connection sharing is called under Linux/Unix). Instructions can be found here.
Attached Files
File Type: pdf router.pdf (9.2 KB, 16 views)

Last edited by bartonski; 11-27-2009 at 10:45 AM.
 
1 members found this post helpful.
Old 11-27-2009, 10:29 AM   #5
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
yes thanks already for responding
 
Old 11-27-2009, 02:10 PM   #6
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
R03L,

Take another look at my previous post, I added a lot more to it; I think that I may have found a solution.

p.s. where does the nickname 'R03L' come from? It sounds a bit like R2-D2 or C-3PO
 
Old 11-30-2009, 05:37 AM   #7
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bartonski View Post
R03L,

Take another look at my previous post, I added a lot more to it; I think that I may have found a solution.

p.s. where does the nickname 'R03L' come from? It sounds a bit like R2-D2 or C-3PO

No My name is actualy Roel it's dutch ( frysian ) name.

just added some numbers to it :P

but verry thanks for helping me out,, i see wats mistaken.

i read verry mutch tutorials and have the LPI book besides me.

but the part of setting a static ip adress was missing from most tutorials. so i think that is wat im doing wrong. i should work on it today
 
Old 11-30-2009, 05:56 AM   #8
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by R03L View Post
ch tutorials and have the LPI book besides me.

but the part of setting a static ip adress was missing from most tutorials. so i think that is wat im doing wrong. i should work on it today
yes im getting an ip adress

Code:
eth0
ip adress : 192.168.2.123
broadcast adress : 192.168.2.255
subnet mask : 255.255.255.0
defaulth route: 192.168.2.1
dns : 192.168.2.1
Thanks Again

so far so good
 
Old 11-30-2009, 06:48 AM   #9
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
when i ping www.google.nl or 192.168.1.1 @ my fileserver i get.

Code:
ping www.google.nl ( ping 192.168.1.1 )
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
what could this be.?


i think its my routing/firewall that still is blocking my connection..

also when i am browzing to www.google.nl i get this pagefaulth
Connection to server Refused
 
Old 11-30-2009, 08:17 AM   #10
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
ok i now get a ping at 192.168.1.1 ( DD-WRT )
but still
Code:
ping www.google.nl
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable

Last edited by R03L; 11-30-2009 at 08:20 AM.
 
Old 11-30-2009, 08:57 AM   #11
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by R03L View Post
ok i now get a ping at 192.168.1.1 ( DD-WRT )
but still
Code:
ping www.google.nl
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
Let's see... DNS is working, must be through dnsmasq. If you can ping to 192.168.1.1, you know that at least part of the routing is working on your server box. The first thing I would do is run

Code:
traceroute www.google.nl
from 192.168.2.100. That will tell you whether the packets headed to www.google.nl are failing at the DD-WRT or before.

I would also try running /sbin/route on both your server and DD-WRT. Read the results from top to bottom, the first route that matches is the path that the packets take.
 
Old 11-30-2009, 09:18 AM   #12
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
By the way, if you absolutely totally have to know every packet going in and out of your DD-WRT, you can use pcap to capture packets. Installation of libpcap is detailed here, about half way down the page. I'm not 100% sure how to get the pcap file from the DD-WRT to your server, but once you do, you can open the file in Wireshark and figure out exactly what's going where.

I would do this only as a last resort, because it's going to take some serious reading to get this correctly installed and get a file back to your server, and then it can be a lot of work filtering through all of those packets, but you'll definitely know what's going on (also, only do this if you have isolated the problem to the DD-WRT).
 
Old 11-30-2009, 09:22 AM   #13
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
Code:
traceroute www.google.nl
traceroute to www.google.nl (74.125.79.104), 30 hops max, 60 byte packets
 1  192.168.2.1 (192.168.2.1)  0.181 ms  0.182 ms  0.260 ms
 2  192.168.2.1 (192.168.2.1)  2998.983 ms !H  2998.996 ms !H  2998.916 ms !H
on Desktop computer 1 i have a ping but half the time it also say destination host unreachable.
and no www.google.nl PAGE is coming up The requested URL could not be retrieved
maybe im on QOS.
becouse the house im living in a room at. also has a router outside the house my DD-WRT router is hooked to...

its 10.0.0.138 (DHCP)

i added some lines to DNSMASQ.
Code:
server=192.168.1.1 (DD-WRT)
server=194.109.6.66 (XS4ALL DNS server 1)
server=194.109.9.99 (XS4ALL DNS Server 2)
server=10.0.0.138 (DHCP / ROUTER whit at least 100 connections FIRM router)

Last edited by R03L; 11-30-2009 at 09:32 AM.
 
Old 11-30-2009, 09:26 AM   #14
R03L
Member
 
Registered: Feb 2008
Distribution: mepis, ubuntu server ed. Debian. Redhat. Fedora, centos, LFS
Posts: 211

Original Poster
Rep: Reputation: 31
DESKTOP PING
Code:
[roel@vlip ~]$ ping www.google.nl
PING www.l.google.com (74.125.79.104) 56(84) bytes of data.
From 192.168.2.1: icmp_seq=1 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=2 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=3 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=1 Destination Host Unreachable
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1: icmp_seq=4 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=5 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=6 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=5 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1: icmp_seq=8 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
^C
--- www.l.google.com ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7459ms
pipe 4
SERVER PING
Code:
[server@server ~]$ ping www.google.nl
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1 icmp_seq=7 Destination Host Unreachable
From 192.168.2.1 icmp_seq=8 Destination Host Unreachable
^C
--- www.l.google.com ping statistics ---
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8140ms
pipe 3
 
Old 11-30-2009, 09:47 AM   #15
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by R03L View Post
DESKTOP PING
Code:
[roel@vlip ~]$ ping www.google.nl
PING www.l.google.com (74.125.79.104) 56(84) bytes of data.
From 192.168.2.1: icmp_seq=1 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=2 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=3 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=1 Destination Host Unreachable
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1: icmp_seq=4 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=5 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=6 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=5 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1: icmp_seq=8 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
^C
--- www.l.google.com ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7459ms
pipe 4
SERVER PING
Code:
[server@server ~]$ ping www.google.nl
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1 icmp_seq=7 Destination Host Unreachable
From 192.168.2.1 icmp_seq=8 Destination Host Unreachable
^C
--- www.l.google.com ping statistics ---
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8140ms
pipe 3
Yeah... there's something messed up here. When pinging from your server, packets should be headed through the wlan interface... you should be pinging from 192.168.1.100, not 192.168.2.1. This does suggest a routing error. I'm late for work (too much time spent answering questions on LQ ). I would definitely run /sbin/route on your server, and figure out what's going where. I'll be able to look at the results this evening (~8pm US Eastern Standard Time).
 
1 members found this post helpful.
  


Reply

Tags
config, configure, connection, dnsmasq, eth0, internet, ip, kernel, network manager, routing, should, table, wired, wireless, wlan, wlan0


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
dnsmasq: failed to bind DHCP server socket: Address already in use taske Linux - Networking 2 11-08-2009 06:40 PM
Need help setting up a dial on demand dnsmasq dhcp server with a decent firewall i nekkutta Slackware 0 03-22-2008 02:19 PM
dnsmasq: no dhcp ryerke Slackware 8 06-03-2007 07:29 PM
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. kublador Linux - Networking 14 05-16-2006 07:33 AM
eth0 not getting IP address from DHCP server Venefyxatu Linux - Networking 4 05-04-2005 07:45 PM


All times are GMT -5. The time now is 06:43 PM.

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