Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th September 2012, 10:07 PM
ibukanov Offline
Registered User
 
Join Date: Sep 2012
Location: Norway
Posts: 2
linuxfirefox
NetworkManager shared connection and custom dnsmasq

Hello,

When I activate a shared connection in NetworkManager, it runs dnsmsq with an empty config file according to the ps axww output:

/usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.42.0.1 --dhcp-range=10.42.0.10,10.42.0.100,60m --dhcp-option=option:router,10.42.0.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-em1.pid

How can I customize this dnsmasq instance and, for example, permanently bind a client with a particular MAC address to a given IP address?
Reply With Quote
  #2  
Old 17th September 2012, 10:46 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
linuxfirefox
Re: NetworkManager shared connection and custom dnsmasq

Quote:
permanently bind a client with a particular MAC address to a given IP address?
You are asking for a configuration that causes the dnsmasq server to offer a specific IP address to a dhcp client with a specific MAC address.

Normally dnsmasq can take this information from /etc/hosts but in this case "--no-hosts" prevents that.
The dnsmasq option --dhcp-host=MAC,name,IPaddr .

The options (not the specific option addresses) are compiled into the NetworkMananger binary.

Scanning the sources it seems you should be able put parameters in
/etc/dnsmasq.d/local (create the file). Something like
dhcp-host=00:11:22:33:44:55,fred,10.12.13.73



Code:
        if (getenv ("NM_DNSMASQ_DEBUG")) {
                nm_cmd_line_add_string (cmd, "--log-dhcp");
                nm_cmd_line_add_string (cmd, "--log-queries");
        }

        /* dnsmasq may read from it's default config file location, which if that
         * location is a valid config file, it will combine with the options here
         * and cause undesirable side-effects.  Like sending bogus IP addresses
         * as the gateway or whatever.  So tell dnsmasq not to use any config file
         * at all.
         */
        nm_cmd_line_add_string (cmd, "--conf-file");

        nm_cmd_line_add_string (cmd, "--no-hosts");
        nm_cmd_line_add_string (cmd, "--keep-in-foreground");
        nm_cmd_line_add_string (cmd, "--bind-interfaces");
        nm_cmd_line_add_string (cmd, "--except-interface=lo");
        nm_cmd_line_add_string (cmd, "--clear-on-reload");
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #3  
Old 19th September 2012, 09:30 PM
ibukanov Offline
Registered User
 
Join Date: Sep 2012
Location: Norway
Posts: 2
linuxfirefox
Re: NetworkManager shared connection and custom dnsmasq

The suggestion to check the source was a good advise . However, I do not see where NetworkManager 0.9.6 tells dnsmaq to read anything from /etc/dnsmasq.d/* as typically it is the config file itself that does that.

As a workaround I simply put into /usr/local/sbin/dnsmasq a script that calls /usr/sbin/dnsmasq. In the script I check for NetworkManager invocation corresponding to the shared connection setup and then simply add --dhcp-host=MAC,IP

Note that putting DNS information into --dhcp-host is useless for my purposes as NetworkmManager does not update resolve.conf with the dns server that dnsmasq provides. So any names that dnsmasq knows about are not visible on my computer. Instead I had to add the name to /etc/hosts
Reply With Quote
Reply

Tags
connection, custom, dnsmasq, networkmanager, shared, shared connection

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bandwidth control when using shared connection Min Wibble 3 15th June 2010 03:46 PM
Can't use Windows shared internet connection in Fedora 11 fardjaddavari Using Fedora 6 21st August 2009 10:01 AM
how to shared internet connection dhenver Servers & Networking 2 4th May 2007 02:58 AM
Would Fedora connect to the internet via an XP-shared connection? Flatron Servers & Networking 3 4th April 2005 08:31 PM
FC3, NetworkManager and a custom kernel cMechanism Hardware & Laptops 1 25th March 2005 01:31 AM


Current GMT-time: 23:26 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat