You are not logged in.

#1 2015-08-09 08:00:16

kilofox5
Member
Registered: 2015-08-09
Posts: 6

[SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

I've been beating my head against the wall for a while now. I've got an old P4 machine that I'm building up to use as a router. I've got WAN connectivity using netctl and have added netctl profiles for the other 3 attached interfaces for LAN connections. Right now I'm running it on a Tomato DD-WRT router and have a test client attached to one of the LAN ports (a Beaglebone that I can SSH into over USB). I can't get a DHCP server to work though - or for that matter tell which enpXsY device relates to which physical device. LAN devices are set to static '192.168.1.1/24' and DHCP range in dnsmasq.conf is set to '192.168.1.50,192.168.1.150,12h'. Eventually, I'm going to be setting up different DHCP ranges for each eth device but right now I'm just trying to get anything to work..

Last edited by kilofox5 (2015-08-17 06:11:04)

Offline

#2 2015-08-09 08:02:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

You probably want to share with the community, which dhcp server you are attempting to use on your Arch box/router and how you have configured it plus indicate that you know it's running, provide logs, etc.  As to figuring out which NIC corresponds to which persistent named device, test them with

udevadm test-builtin net_id /sys/class/net/foo

Or disable persistent renaming by creating the empty-file: /usr/lib/udev/rules.d/80-net-name-slot.rules

Last edited by graysky (2015-08-09 08:05:13)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2015-08-09 08:40:37

kilofox5
Member
Registered: 2015-08-09
Posts: 6

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Right - Using DNSmasq for the DHCP and I can't find a log file for it. I dug around through /var and can't seem to stumble across it. I would have provided more information but I'm still in the process of learning Linux in general, much less the more intense Arch environment (that being said I have learned A TON about Linux now) so I'm not really sure what's pertinent. I've basically followed the Router wiki article up till this point.

I know DNSmasq is running - I can grep it out of systemctl and see it's loaded, active, running. I've also noticed that two of the set up cards load but fail (I'm pretty sure because there is no physical device attached to them - need to set up ifplugd I suppose). I've also noticed that if I restart the one working (on boot) netctl profile (enp2s1) it fails with

No connection found on interface 'enp2s1' <timeout>

Unfortunately, the udevadm doesn't help me since they are all the same card. I'll just open up the case tomorrow and check the printed MAC addresses against the device name (should have thought of that sooner now that I think about it).

Offline

#4 2015-08-10 10:20:52

kilofox5
Member
Registered: 2015-08-09
Posts: 6

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Just an update and further cry for help lol - I sat down and tracked which device was which and discovered that I was connected to the wrong eth device for testing. So I corrected that and now I get slow blinking eth port lights on the test client (enp2s1 is the "working" device). Also, here is my current dnsmasq.conf file http://pastebin.com/Ag1MHAxG since it's still not handing out an IP address to my test client. I still can't track down a log file for DNSmasq though. However, here is the output from 'journalctl -xe' after a restart of dnsmasq and attempted DHCP lease from the test client.

Aug 10 05:05:04 router polkitd[371]: Unregistered Authentication Agent for unix-process:422:76819
Aug 10 05:05:04 router dnsmasq[431]: started, version 2.75 cachesize 150
Aug 10 05:05:04 router dnsmasq[431]: compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect inotify
Aug 10 05:05:04 router dnsmasq[431]: DBus support enabled: connected to system bus
Aug 10 05:05:04 router dnsmasq[431]: warning: interface enp7s0 does not currently exist
Aug 10 05:05:04 router dnsmasq[431]: warning: interface enp2s2 does not currently exist
Aug 10 05:05:04 router dnsmasq-dhcp[431]: DHCP, IP range 192.168.1.50 -- 192.168.1.150, lease time
Aug 10 05:05:04 router dnsmasq[431]: using nameserver 8.8.8.8#53
Aug 10 05:05:04 router dnsmasq[431]: reading /etc/resolv.conf
Aug 10 05:05:04 router dnsmasq[431]: using nameserver 8.8.8.8#53
Aug 10 05:05:04 router dnsmasq[431]: using nameserver 192.168.10.1#53
Aug 10 05:05:04 router dnsmasq[431]: read /etc/hosts - 2 addresses

and also the netctl profile for the ethernet device that I'm attempting to use

Description='LAN Top PCI Slot'
Interface=enp2s1
Connection=ethernet
IP='static'
Address=('192.168.1.1/24')

Also, whenever I attempt to restart the working enp2s1 profile (working on boot) it fails with journalctl output

-- Unit netctl@enp2s1.service has begun starting up.
Aug 10 05:15:30 router network[482]: Starting network profile 'enp2s1'...
Aug 10 05:15:30 router kernel: enp2s1:  setting half-duplex.
Aug 10 05:15:30 router kernel: IPv6: ADDRCONF(NETDEV_UP): enp2s1: link is not ready
Aug 10 05:15:35 router network[482]: No connection found on interface 'enp2s1' (timeout)
Aug 10 05:15:35 router network[482]: Failed to bring the network up for profile 'enp2s1'
Aug 10 05:15:35 router systemd[1]: netctl@enp2s1.service: Main process exited, code=exited, status=1/FAILURE
Aug 10 05:15:35 router systemd[1]: Failed to start Internal enp2s1.
-- Subject: Unit netctl@enp2s1.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit netctl@enp2s1.service has failed.

Offline

#5 2015-08-12 00:27:55

kilofox5
Member
Registered: 2015-08-09
Posts: 6

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Anybody? I'm out of ideas.

Offline

#6 2015-08-12 20:43:26

kilofox5
Member
Registered: 2015-08-09
Posts: 6

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Any DHCP alternatives or suggestions at all? I'd like to get this working so I can start setting up the fun stuff for my home network.

Offline

#7 2015-08-13 01:29:25

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Well...

  1. Netctl will fail if no carrier is detected. See man netctl and related how to avoid this.

  2. If you want a switch, you need to bridge the cards and give an ip only to the bridge. Netctl can do this too.

  3. If you want different zones, you need to give each card an own subnet, otherwise your routing will be messed up.

  4. Setup ip-forwarding and iptables as needed.

  5. Remember: Broadcasts will not be routed...

  6. As always: Start simple. Use only one interface and give a static ip to both ends. If you can ping in both directions, setup dnsmasq/dhcp for this. Setup ip-forwarding/iptables and see if the client can get out of the wan interface. If everything works, make it more complicated by changing the configuration like hinted above.

Good luck.

Edit: Slight clarification

Last edited by Tarqi (2015-08-13 02:01:22)


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#8 2015-08-17 06:10:32

kilofox5
Member
Registered: 2015-08-09
Posts: 6

Re: [SOLVED] DNSmasq not handing out DHCP and netctl profiles not starting

Had to repair a dead drive on my main system (made the switch to Win 10 while in the process so a bit of lose-win) however.... This made me abandon the Beaglebone as the test client and wouldn't you know it...I connect the Windows client, configure for DHCP and address registered...Also - The netctl failures were fixed by adding "SkipNoCarier=yes"

Just a case of bad test configuration that should have occurred to me ages ago -_-

Thanks for the help Tarqi and graysky - Now to set up IP forwarding and whatnot - Marking as solved

Offline

Board footer

Powered by FluxBB