Monday, September 16, 2019

Configuring h2gt2g

The Plan

My next step is to set up my e-mail server. I want that VM to be on the SAN. So I need to get iSCSI going. Also I need to get the home directories working, so it has a place for the .forward files and the inboxes and etc. I’m concerned that the new drives won’t match the drive that’s already in the SAN, so I want to do that first before I muck about with the configuration.
  1. Install the drives in the SAN
  2. Configure iSCSI
  3. Get home directories using automount working
That last part may be quite a bit of trouble. I never got it working reliably before.

Installing the Drives in the SAN

Hitchhikers Guide to the Galaxy - h2gt2g
I installed 2 more drives and put screws in the drive that was already in there plus the new drives, then reseated them.
enter image description here
enter image description here
enter image description here
Powered it back up and then had kinda a start, the power light started blinking rather than other stuff coming up. It did it for a long time, long enough that I thought huh, this is long, and then googling it. Long enough to find out that the ‘blinking blue light of death’ was a thing, and it meant a dead motherboard. Long enough to think Oh Shit, I can’t afford another one of these. Then it went beep and all the happy lights came on. Whew…
The new drives are indeed the same size so everything was easy peasyenter image description here

Configure iSCSI

Oh hey, lookie here how to integrate a synology nas in your vmware lab that’s exactly what I’m doing.
He’s suggesting using file based iSCSI. His reasoning is that the synology is used for other things, as is mine. However it sounds like the target is per volume and I believe I can configure this to be multi-volume. I’d like to try it, however it is busy expanding the storage pool and syncing the raid which sadly has greyed out everything. So, file based it is, we can revisit it later. And it looks like I don’t even get that choice since I got the cheap SAN.
I just followed his instructions and created the iSCSI target.
enter image description here
Now onto the esx server.
Looks like the esx server isn’t visible anymore. I believe you have to set up networking from the console anyway. Switched the cables around from the laptop to the server and that was messed up too. Grrr… Next thing I’m going to try is to put the dhcp and dns back. Or… actually before that find out what heartogold was set to before. Yeah that works 192.168.42.3.
I added the A record for heartogold to the new dns server. Then I got annoyed because it insists on putting up an error that you have to acknowledge every time you update the screen. Several of my devices have spaces in the name they’re asking for from dhcp which fucks up dns.
Anyway, the TVs had spaces in the name, I went to my.roku.com and changed the name of the devices. The other thing a levitron switch I couldn’t fix, so I gave it a fixed address in dhcpd.conf.
And now for something really brain dead. I deleted the network the management console was on. Mainly because I named it deepthot.int, and I wanted to get rid of it. Foolish girl. So I ended up having to reset the esx server to its default and recovering the VMs. Turns out not to have been as painful as I feared, so yay. This time I think I’ve got it set up so that you can change the IP from the console. That was greyed out which didn’t help matters any. Anyway what I did was:
  1. From the console reset the configuration
  2. After it booted set up the IP 192.168.42.3
  3. While I was going crazy the desktop machines lost their IPs and stuff since the vsphere was doing the dhcp. I manually set up the ip and set the dns to google.
  4. Went into the esx web page and recovered the VM and booted them up.
Configuring iSCSI is kinda a pia. Or rather it’s unobvious, at least to me how to do it. You have to go into storage, adapters, and click on the configure iSCSI, then fill it out like this
iSCSI configuration
Then, and this took me awhile to figure out, you have to partition the iSCSI device. Go into the devices tab right click on the iSCSI disk that is there now, and select edit partition table.
Edit partition table
Then it shows up as a datastore. Huzzah
Datastore with iSCSI target
I didn’t grok that you needed to create a partition table. I just set up the target and wondered why it wasn’t showing up.
I think I’ve done enough for today, especially given that disaster. So tomorrow automount I think.
Haven’t gotten very far, way far from automount at this point, there’s a whole bunch of freeipa stuff to set up before I get to there. I’ve forgotten most of it. Anyway…
To set the hostname with dhcp on bionic beaver you need to do more than install. You also need to edit /etc/cloud/cloud.cfg and change preserve_hostname: false then reboot. And, of course on ipa you need to killall -HUP named-pkcs11 and on the laptop sudo systemd-resolve --flush-caches

Sunday, September 15, 2019

Updating FreeIPA's DNS from DHCP

Updating FreeIPA’s DNS from DHCP

My next thing is to switch deepthot over to freeIpa’s dns.
  1. Look around freeipa to make sure it’s set up
  2. Give permissions to the dhcp on services.deepthot to use it
  3. Edit the dhcp to switch the domain, dns, and which dns to update.
  4. Restart dhcp and hope for the best
Checked out IPA. It was down, trying to recover. This was probably due to me mucking about with the IP. Yes, the ip was still in the hosts file, changed it to the current IP and it came right up. Better check the other machines to see if it’s in the hosts file. Only place was the laptop and it was already fixed.
Poked around the IPA DNS. Looks ok. I’m going to test it now. Won’t work for internal addresses, obviously, but should for external ones.
I need to investigate this. I did notice that when I switched to the configuration on the laptop that was using ipa for dns all of my ssh sessions froze. So something more could be going on there. Perhaps I should just edit /etc/resolv.conf by hand and see if I still have a problem.
On ipa:
[root@ipa ~]# dig ipa.deepthot.aa @192.168.42.4

; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.2 <<>> ipa.deepthot.aa @192.168.42.4
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65502
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ipa.deepthot.aa.  IN A

;; ANSWER SECTION:
ipa.deepthot.aa. 1200 IN A 192.168.42.4

;; AUTHORITY SECTION:
deepthot.aa.  86400 IN NS ipa.deepthot.aa.

;; Query time: 0 msec
;; SERVER: 192.168.42.4#53(192.168.42.4)
;; WHEN: Sat Sep 14 08:23:24 MST 2019
;; MSG SIZE  rcvd: 74
However on my laptop:
denebeim@frankiemouse:~$ dig ipa.deepthot.aa @192.168.42.4

; <<>> DiG 9.11.3-1ubuntu1.9-Ubuntu <<>> ipa.deepthot.aa @192.168.42.4
;; global options: +cmd
;; connection timed out; no servers could be reached
So, something isn’t right. Researching freeipa dns… I didn’t see anything funky, however, looks like the firewall wasn’t allowing DNS. (do I want a firewall on my internal lan?)
Big question: Do I want deepthot.aa or should I just do int.deepthot.org for the internal lan? That seems to be what freeipa is telling me and they may be right. It says DNSSEC is way better if you do this. Also, one step is to probably take over my DNS master. I need to figure out how to get dreamhost to just be a secondary. I miss having control of my DNS.
And the answer was, in fact, the firewall. I fixed it for the time being with firewall-cmd --permanent --add-service dns;firewall-cmd --reload

Configure DHCP with FreeIPA

According to freeipa DDNS configuration as far as ipa is concerned you just have to grant dhcpupdate wildcard * ANY; to the Bind update policy section of the DNS zone settings.
I edited dhcpd.conf to use deepthot.aa as the domain, reset the nameserver to ns.deepthot.aa, reset the primary on the zones to 192.168.42.4
< option domain-name "deepthot";
< option domain-name-servers ns.deepthot;
---
> option domain-name "deepthot.aa";
> option domain-name-servers ns.deepthot.aa;
120c120
< #update-static-leases on;
---
> update-static-leases on;
126c126
<             primary 192.168.42.2;
---
>             primary 192.168.42.4;
130c130
<             primary 192.168.42.2;
---
>             primary 192.168.42.4;
Nothing really came out in the logs. It didn’t appear to work. Tried adding a ns CNAME ipa to the ipa dns. I can’t seem to look it up anywhere. None of the updates are happening in IPA.
Kinda stuck at the moment. Going to take a break.
I did find something, a couple of things, first adding records to freeipa doesn’t show up immediately, obviously because of caching. In bionic you clear the dns cache with systemd-resolve --flush-caches Oddly enough changing dns in freeipa does not show up immediately even on the freeipa box. That kinda sucks You need to do killall -HUP named-pkcs11
I figured out what the problem was, in fact you can see it in that diff above, or not see it. The problem was that the dns zone wasn’t updated from deepthot to deepthot.aa. Here’s where the networks are declared:
subnet 192.168.42.0 netmask 255.255.255.0 {
       authoritative;
       range 192.168.42.100 192.168.42.254;
       zone 42.168.192.in-addr.arpa. {
            primary 192.168.42.4;
     key dhcpupdate;
     }
       zone deepthot.aa. {
            primary 192.168.42.4;
     key dhcpupdate;
     }
}

Thursday, September 12, 2019

Really Basic Stuff

Day 1

So, I got on my laptop and no internet, not really sure what was going on with that.  Mucked about with it awhile and then just rebooted it.  That seemed to fix it.


  1. So, tonight, my plan is to get freeipa partially configured
  2. Configure free ipa to do the dns
  3. Switch the dhcp over to use the freeipa dns
  4. Create an iSCSI on h2gt2g
  5. Make a VM using the aforementioned iSCSI
  6. Install a basic ubuntu on it
  7. Get freeipa client going on it
And so we begin
I'm following https://www.linuxtechi.com/install-configure-freeipa-centos-7-server/ to make sure it's working.  At this point I think I've only created the VM, installed free-ipa-server on it and run the configuration script.  It seems to be working
From the blog I ran:
  • authconfig --enablemkhomedir --update
  • firewall-cmd --add-service=freeipa-ldap --permanent
    • Warning: ALREADY_ENABLED: freeipa-ldap
    • success
    • Guess I already ran it
  • ipactl status
    • Hunky Dory

[root@ipa ~]# kinit admin
Password for admin@DEEPTHOT.AA: 
[root@ipa ~]# klistI
Ticket cache: KEYRING:persistent:0:0
Default principal: admin@DEEPTHOT.AA

Valid starting       Expires              Service principal
09/12/2019 19:29:12  09/13/2019 19:29:09  krbtgt/DEEPTHOT.AA@DEEPTHOT.AA

I guess I already did this stuff, I'm at the end of the blog.  So, what to do next

Next thing is get dhcp to update the dns server on freeipa instead of the one on services.  I'm using this blog https://www.freeipa.org/page/Howto/ISC_DHCPd_and_Dynamic_DNS_update 

If you want to have emacs do x11 on centos you need at a minimum the emacs and xorg-x11-xauth packages.  The xauth package is not required by emacs for some reason.

Almost have the ddns working, but getting too tired.  I believe what I want to do is:

  1. generate a shared secret for ddns
  2. put that key into dhcp, the new dns server, *and the old one*
  3. on dhcp server update 'primary' key in the zones to 192.168.42.4
  4. on dhcp server change ipa to have a fixed address of 192.168.42.4
  5. find all the /etc/hosts that have ipa defined (minimum ipa and the laptop) and change the address to 192.168.42.4
  6. in freeipa 

grant DDNS_UPDATE wildcard * ANY;

Day 2

I'm following https://www.semicomplete.com/articles/dynamic-dns-with-dhcp/ to set up the new DDNS.  I figure I'll create the new key, then install it on all 3 places before trying to change stuff around.  (referencing the list from yesterday)

Just investigated wordpress.com I'm really hating not having code blocks here.  I've just had blogger for so long, not that I do anything with it...  Anyway to work.

I got the ddns switched over to the new key.  I had a very annoying issue with the permission for reading the key for the old name server.  I ended up copying the key to both named and dhcp configuration directories to handle that.

I really like to have only one place where configuration is.  Since dhcp is updating the dns I would really like to have it manage the dns for statically defined machines.  However there is a large stupid problem:

Basically to have dhcp update static you have to have two things, first for every static definition you have to have ddns-hostname defined, like so:

host ipa {
     hardware ethernet 00:0c:29:4b:43:85;
     fixed-address 192.168.42.4;
     ddns-hostname ipa;
}

Additionally you have to have update-static-leases on; defined as well.  The problem with this is that it says that it has no way to tell if a lease was released so it updates the DNS every time.  This kinda sucks because it is pulling down the records and reentering exactly the same data every 5 minutes for every static ip that I'm setting with DNS.  I don't think name servers should be dynamic so I've got it statically linked.  And the router and dhcp server also need to be static.

Anyway, I'm going to dwell on this awhile.  The flip side is the dns data file is kinda a mess when it has records that are originally there and records that are updated.  It would be nice if the file had two seconds one for stuff that was there originally and one for the dynamically updated portion.  I don't particularly want to have separate namespaces, which I think is the only choice.  If you want to remove all of the dynamically updated records you have to go digging through it by hand to remove everything.  It's kinda  a pain.

So, I'm going to leave it this way for the time being.

Current status:

  1. new key installed in dhcp and the old name server
  2. ddns records updated.  ipa now at a static address
I'm going to stop this now, I've found a cool app StackEdit what it does is it allows you to create a document in markdown and then publish it to blogger, wordpress, or whatever.  It's a good markdown so it ends up making a much nicer looking blog than blogger does by itself.

What I Wanna Do with This Blog

I've had a domain on the internet for a very long while, deepthot.org.  Recently it died and I wanna get it back.  This blog is documenting what I'm doing.  So really boring, but hey at least I won't end up spending forever recreating it next time I hope.

So, here's the new computer, it's rather a beast.  It's like 64gigs and I think 12 or so cores.  It was gifted to me by a friend who wisely left the country a year or so ago and left his computer, but took his drives.  Smart guy.
heartogold being ridden by frankiemouse and h2gt2g
Anyway, I had it half way set up a while ago and then lost interest or whatever.  Now my internet machine and my media server died.  I'm kinda forced to stop procrastinating and get my ass in gear.

Even now it's been awhile.  I did get the system back up, I got dhcp and dns up and routing over the net a couple of weeks ago.  That was what I *had* to do.  But I still don't have my e-mail server or my media server up.  Those are the first things I need to do, but they're still a ways off yet.  I've got a VM running freeipa in addition to the one doing the dns and dhcp.  Before I had the one doing dns and dhcp also doing freeipa.  However when I started trying to get things back I discovered it wasn't working and the notes I took weren't worth a shit.  So here we are.

The plan is to document everything I do.  Take copious notes and go with that.

This is a new blog I just came up with a name for before I wasn't able to come up with a name for a blog for this project, so the entries are on my other blog Joyous Transformations

How Simple Does It Have to Be Before It’s Mine?

 Hi, Joy here, I'm tired.  I'm too tired to polish this.  However bare with me, the text below is *trying* to be me.  It's not l...