Login  Register

Re: Dead fish?

Posted by Roadrunnere42 on May 01, 2019; 8:14pm
URL: https://itus.accessinnov.com/Dead-fish-tp1712p1719.html

Hi Grommish
I thought  that shield used dnsmasq to obtain address, it's been sometime since looking at the Shield, but I did use these notes when I was playing with the Shield, Not sure if it was for the Shield or for my computer to talk to  the Shields bootp process.
HOWTO: Setup dnsmasq as DNS DHCP
5 Replies   

This description of dnsmasq shamelessly take from the dnsmasq home page.

dnsmasq is a lightweight DNS, TFTP, PXE, router advertisement and DHCP server. It is intended to provide coupled DNS and DHCP service to a LAN.

Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts. It can also act as the authoritative DNS server for one or more domains, allowing local names to appear in the global DNS.

The dnsmasq DHCP server supports static address assignments and multiple networks. It automatically sends a sensible default set of DHCP options, and can be configured to send any desired set of DHCP options, including vendor-encapsulated options. It includes a secure, read-only, TFTP server to allow net/PXE boot of DHCP hosts and also supports BOOTP. The PXE support is full featured, and includes a proxy mode which supplies PXE information to clients whilst DHCP address allocation is done by another server.

The dnsmasq DHCPv6 server provides the same set of features as the DHCPv4 server, and in addition, it includes router advertisements and a neat feature which allows naming for clients which use DHCPv4 and stateless auto-configuration only for IPv6 configuration. There is support for doing address allocation (both DHCPv6 and RA) from subnets which are dynamically delegated via DHCPv6 prefix delegation.

Dnsmasq is coded with small embedded systems in mind. It aims for the smallest possible memory footprint compatible with the supported functions, and allows unneeded functions to be omitted from the compiled binary.

In short, IT IS EXCELLENT!!

Installing dnsmasq is just a case of using apt-get or yum

sudo apt-get install dnsmasq

Looking at the file /etc/dnsmasq.conf first. The lines are listed are those that I changed from their defaults. Just uncomment and amend them as necessary. (Remove the ‘#’ from the beginning of the line).

sudo nano /etc/dnsmasq.conf

domain-needed
bogus-priv
no-resolv
no-poll
server=/example.com/192.168.0.5
server=8.8.8.8
server=208.67.220.220
local=/example.com/
address=/doubleclick.net/127.0.0.1
no-hosts
addn-hosts=/etc/dnsmasq.d/hosts.conf
expand-hosts
domain=example.com
dhcp-range=192.168.0.20,192.168.0.50,72h
dhcp-range=tftp,192.168.0.250,192.168.0.254 
hcp-host=mylaptop,192.168.0.199,36h
dhcp-option=option:router,192.168.0.1
dhcp-option=option:ntp-server,192.168.0.5
dhcp-option=19,0 # ip-forwarding off
dhcp-option=44,192.168.0.5 # set netbios-over-TCP/IP aka WINS
dhcp-option=45,192.168.0.5 # netbios datagram distribution server
dhcp-option=46,8           # netbios node type

What these lines will do for you.

    domain-needed This tells dnsmasq to never pass short names to the upstream DNS servers. If the name is not in the local /etc/hosts file then “not found” will be returned.
    bogus-priv All reverse IP (192.168.x.x) lookups that are not found in /etc/hosts will be returned as “no such domain” and not forwarded to the upstream servers.
    no-resolv Do not read resolv.conf to find the servers where to lookup dns.
    no-poll Do not poll resolv.conf for changes
    server=8.8.8.8 Set one or more DNS servers to use when addresses are not local. These are open DNS servers.
    local=/example.com/ Our local domain, queries in these domains are answered from /etc/hosts or the static-hosts files.
    address=/doubleclick.net/127.0.0.1 Use this force an address for the specified domains. e.g to block adverts force doubleclck.net to localhost
    no-hosts This options stops dnsmasq using the local /etc/hosts file as a source for lookups .
    addn-hosts=/etc/dnsmasq.d/static/hosts.conf Force dnsmasq to use this file for lookups. It is in the same format as /etc/hosts.
    expand_hosts So we can see our local hosts via our home domain without having to repeatedly specify the domain in our /etc/hosts file.
    domain This is your local domain name. It will tell the DHCP server which host to give out IP addresses for.
    dhcp-range This is the range of IPs that DHCP will serve: 192.168.0.20 to 192.168.0.50, with a lease time of 72 hours. The lease time is how long that IP will be linked to a host. (All most :-) )
    dhcp-range=tftp,192.168.0.250,192.168.0.255 For tftp connections use this range of IP addresses
    dhcp-host=mylaptop,192.168.0.199,36h Any machine saying they are hostname = ‘mylaptop’ gets this IP address
    dhcp-option=option:router,192.168.0.1 When a host is requesting an IP address via DHCP also tell it the gateway to use.
    dhcp-option=option:ntp-server,192.168.0.5 When a host is requesting an IP address via DHCP also tell it the NTP to use.

    In the file /etc/dnsmasq.d/hosts.conf you can add a list of local machines with static IP addresses in the same format as the hosts file. It is also an easy way of creating aliases or CNAME records.

    192.168.0.8  mail mail.example.com
    192.168.0.9  smtp smtp.example.com
    192.168.0.120 mythtvbox mythtvbox.example.com

    Starting and stopping the service

    sudo service dnsmasq start
    sudo service dnsmasq stop
    sudo service dnsmasq restart

    Useful links
        Home Page for dnsmasq
        Man Page for dnsmasq

Andrew

On Wed, 1 May 2019 at 19:06, Grommish [via Itus Networks Owners Forum] <[hidden email]> wrote:
That would be fantastic.  No disparaging anyone who has ever posted something great and helpful over the years, but it seems (from my quick viewing of the older threads) that you, user, and Hans seem to be the ones who managed to get anything done with the Shield.  Your insights and help would be an immense boon!

Below is a list of the things I've "added" so far.  I'm still working over the console cable though, because the damn thing simply will NOT take a dhcp address.  I must be doing something wrong in /etc/config/network.  All of my experience comes from Deb/Ubuntu, which uses dhclient, not dhcpcd which is the only DHCP Client I can find in OpenWRT.  I did add bash, nano (damn, I hate vi!), dmesg, sudo, curl, wget, snort, luCi, some compression tools (like bzip/gzip), etc to make life easier once I get connectivity and can get opkg working again.  nano works inside of puTTY, but not worth a damn inside of minicom.

Anyone who is interested in helping me work through these issues should feel free to hit me up on Google Hangouts ([hidden email])

******
CONFIG_TARGET_octeon=y
CONFIG_TARGET_octeon_Default=y
CONFIG_TARGET_BOARD="octeon"
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_EC=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_atftp=y
CONFIG_PACKAGE_bash=y
CONFIG_PACKAGE_bzip2=y
CONFIG_PACKAGE_ca-bundle=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_dhcpcd=y
CONFIG_PACKAGE_dmesg=y
CONFIG_PACKAGE_gzip=y
CONFIG_PACKAGE_libbz2=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libdaq=y
CONFIG_PACKAGE_libdnet=y
CONFIG_PACKAGE_libiwinfo=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libmbedtls=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libpcre=y
CONFIG_PACKAGE_libreadline=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_snort=y
CONFIG_PACKAGE_sudo=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_uclibcxx=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_unzip=y
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_zip=y
CONFIG_PACKAGE_zlib=y


If you reply to this email, your message will be added to the discussion below:
http://itus.accessinnov.com/Dead-fish-tp1712p1718.html
To start a new topic under Technical Discussion, email [hidden email]
To unsubscribe from Itus Networks Owners Forum, click here.
NAML