[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 Code:
sudo /etc/init.d/dnsmasq restart 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 :) |
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'.
If you can answer these, as well as any other special setup on your network, I'll be in a better position to help. |
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.* |
1 Attachment(s)
Quote:
http://e1h13.simplecdn.net/lqcdn/ima...attach/pdf.gif So... here's how I'm reading this:
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. |
yes thanks already for responding :)
|
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 :D |
Quote:
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 :) |
Quote:
Code:
eth0 so far so good :D |
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 ) 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 |
ok i now get a ping at 192.168.1.1 ( DD-WRT )
but still Code:
ping www.google.nl |
Quote:
Code:
traceroute www.google.nl 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. |
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). |
Code:
traceroute www.google.nl 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) |
DESKTOP PING
Code:
[roel@vlip ~]$ ping www.google.nl Code:
[server@server ~]$ ping www.google.nl |
Quote:
|
ok i now got the ping req. at 192.168.2.100 but still same ping messages. destination host unreachable.
it should ping from wlan0 not eth0 so i think it should ping @ 192.168.1.102 |
i did
Code:
iptables -F Code:
service iptables save also i disabled the firewall creator that was inplamented by fedora 12 now all rules and chains will clear ! afther that i did Code:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE but still afther reboot i get the same ping req. Quote:
|
I think that you have the hoses hooked up right, but you're pumping the water the wrong direction.
Look at it this way: Iptables enables packets sent from wlan0 to be sent to eth0 or vise versa. It also alters the packets as necessary so that packets sent from wlan0 through eth0 are well formed... but Iptables has no idea which way the internet is located. It's just connecting this pipe to that pipe, and saying 'I"m acting like a router' or 'I'm acting like a switch'. There's absolutely no logic inherent in iptables that says packets headed for the internet need to be sent through wlan0. That logic lives in the routing tables. In order to print out the routing tables on your server, run the following command: Code:
/sbin/route |
Code:
/sbin/route: |
Quote:
|
Quote:
First, delete the routes to 192.168.1.1; these are going through the wrong interface. Code:
route del -host 192.168.1.1 Code:
route add -host 192.168.1.1 netmask 255.255.255.255 dev wlan0 Code:
192.168.1.0 * 255.255.255.0 U 2 0 0 wlan0 Quote:
|
[solved]
Quote:
Code:
route: netmask doesnt make sense whit host route Code:
route add -host 192.168.1.1 dev wlan0 Thanks for helping me out whit this... [SOLVED] ONLY one thing.. how do i set this perminantly? Fedora 12 ((afther i reboot NetworkManager i need to set route again. also if i reconnect wlan0 i need to set route again!!)) |
Quote:
Code:
/etc/rc.d/rc.local Code:
route add -host 192.168.1.1 dev wlan0 i read on this forum when the init scripts get updated rc.local will be cleared? also when i disconnect from wlan0 i need to reboot for rc.local to be read again. |
Quote:
Thanks for working with the route stuff, that was uncharted territory for me... I know how it works on a theoretical level, but I've never had the need or opportunity to actually change the routing. (The one time I did, I was very very new to networking and ended up routing packets back to the network that they came from, doubling the network load... someone else had to trouble shoot that one for me). Where did you find the info about setting routes in rc.local? |
here s the post
http://www.linuxquestions.org/questi...c-route-16769/ |
Quote:
if there was it made life much easyer |
Quote:
Quote:
|
Code:
/etc/sysconfig/network-scripts/route-eth0 but there is no Code:
/etc/sysconfig/network-scripts/route-wlan0 yes im new to setting routes. but thats the seccond point why im interesed in these things. im doing study LPI 1 so im little ahead on my study whit thisone. |
Quote:
I'd like to see route-eth0, partly because I'm running a Debian system that doesn't use that file, and I'm curious to see it, and partly because it might be useful. |
/etc/sysconfig/network-scripts/eth0
Code:
i think created by networkmanager |
Quote:
I think that you can change route-eth0 as follows: Code:
The routing on wlan0 will take care of its self, because the route is set dynamically when the IP address is assigned via DHCP. |
Quote:
Nah mijn name is roel :) |
All times are GMT -5. The time now is 04:11 AM. |