swampdog
Posts: 221
Joined: Fri Dec 04, 2015 11:22 am

iscsi & dhcp

Fri Mar 11, 2016 12:14 am

Hi Folks,

I'm stumped on this one. My dhcp server is (FreeBSD 8.2-RELEASE-p4)..

Code: Select all

[email protected]$ dhcpd --version
isc-dhcpd-V3.1.2p1
The client is (Raspberry 4.1.18-v7+)..

Code: Select all

[email protected]$ dhcpcd --version
dhcpcd 6.7.1
I cross-compiled kernel7.img with "CONFIG_ISCSI_TCP=y" then generated an"initrd7.img" via 'update-initramfs'. All appeared to be okay - then I noticed I'm getting two IP addresses bound. From FreeBSD dhcp.leases..

Code: Select all

lease 192.168.1.53 {
  starts 3 2016/03/09 14:09:27;
  ends 3 2016/03/09 14:19:27;
  tstp 3 2016/03/09 14:19:27;
  cltt 3 2016/03/09 14:09:27;
  binding state free;
  hardware ethernet b8:27:eb:0f:32:64;
}

lease 192.168.1.45 {
  starts 4 2016/03/10 22:55:11;
  ends 4 2016/03/10 23:05:11;
  cltt 4 2016/03/10 22:55:11;
  binding state active;
  next binding state free;
  hardware ethernet b8:27:eb:0f:32:64;
  uid "\001\270'\353\0172d";
  set ddns-rev-name = "45.1.168.192.in-addr.arpa";
  set ddns-txt = "318788caec8944734a9e0c2fe418c9db6f";
  set ddns-fwd-name = "pi05.swampdog";
  client-hostname "pi05";
}

lease 192.168.1.45 {
  starts 4 2016/03/10 23:00:11;
  ends 4 2016/03/10 23:10:11;
  cltt 4 2016/03/10 23:00:11;
  binding state active;
  next binding state free;
  hardware ethernet b8:27:eb:0f:32:64;
  uid "\001\270'\353\0172d";
  set ddns-rev-name = "45.1.168.192.in-addr.arpa";
  set ddns-txt = "318788caec8944734a9e0c2fe418c9db6f";
  set ddns-fwd-name = "pi05.swampdog";
  client-hostname "pi05";
}
(repeat *.45 lease)

Code: Select all

[email protected]:~ $ ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:0f:32:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.53/26 brd 192.168.1.63 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.45/26 brd 192.168.1.63 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe0f:3264/64 scope link 
       valid_lft forever preferred_lft forever

Code: Select all

[email protected]:~ $ ip route show
default via 192.168.1.1 dev eth0 
default via 192.168.1.1 dev eth0  metric 202 
192.168.1.0/26 dev eth0  proto kernel  scope link  src 192.168.1.45  metric 202

Code: Select all

[email protected]:~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 ip=::::pi05::dhcp root=/dev/sda1 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
The critical problem is 192.168.1.53 (the initrd7.img dhcp request) expires after ten minutes and can get reallocated. I've googled the problem to death and found little of use for this exact problem. I haven't even been able to figure out which of the two IP addresses I should be concentrating on as "the correct one".

*.53 comes first so in principle it should be inherited by the kernel. However *.45 gets configured properly. Unfortunately it comes as no surprise the iscsi target is using the initrd7.img *.53 IP..

Code: Select all

[email protected] ~]$ sudo tgt-admin -s
Target 3: iqn.2013-11.swampdog:sdhp0.target3
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 23
            Initiator: iqn.1993-08.org.debian:01:15523dc6245d:pi05
            Connection: 0
                IP Address: 192.168.1.53
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00030000
            SCSI SN: beaf30
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00030001
            SCSI SN: beaf31
            Size: 34360 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/vg01/T3L1pi05
            Backing store flags: 
    Account information:
        mrISCSI
    ACL information:
        ALL
        iqn.1993-08.org.debian:01:15523dc6245d:pi05
..looks like I'm going to be stuck with *.53 so grateful for any thoughts?

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: iscsi & dhcp

Fri Mar 11, 2016 5:23 am

I assume your raspberry-filesystem is on the ISCSI-target?
Then the connection to *.53 should never been cut? (And not expire?)

May be the *.45 comes from later started services, which are now useless in your point of usage.
Can you avoid the start of all of them?

Best Regards, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

swampdog
Posts: 221
Joined: Fri Dec 04, 2015 11:22 am

Re: iscsi & dhcp

Fri Mar 11, 2016 6:03 pm

Yes the pi is presented..

Code: Select all

[email protected]:~ $ sudo -i lsscsi
[0:0:0:0]    storage IET      Controller       0001  -        
[0:0:0:1]    disk    IET      VIRTUAL-DISK     0001  /dev/sda
..which corresponds to the 'tgt-admin -s' output which has *.53 as its connection ip address so to clarify the order of events is this:

initrd7img <- *.53 from dhcpd -> iscsi
kernel7.img <- *.45 from dhcpd -> nslookup pi05 (iyswim).
and both ip's are bound to eth0.

Code: Select all

[email protected]:~ $ nslookup pi05
Server:		192.168.1.8
Address:	192.168.1.8#53
Name:	pi05.swampdog
Address: 192.168.1.45

[email protected]:~ $ nslookup 192.168.1.45
Server:		192.168.1.8
Address:	192.168.1.8#53
45.1.168.192.in-addr.arpa	name = pi05.swampdog.
In effect kernel7.img is correctly renewing its lease but there is nothing to perform the same task for *.53 as initrd7.img has completed.

Code: Select all

[email protected]:~ $ nslookup 192.168.1.53
Server:		192.168.1.8
Address:	192.168.1.8#53
** server can't find 53.1.168.192.in-addr.arpa: NXDOMAIN
Ideally I need some way to have kernel7.img inherit the initrd7.img *.53 address. The trouble is I can envisage so many wrong ways to go about this!

TIA
Guy

Return to “Advanced users”