hyperion icon indicating copy to clipboard operation
hyperion copied to clipboard

Hercules won't set MAC address for LCS SNA device

Open blackbit42 opened this issue 1 year ago • 3 comments

I want to use a LCS device for SNA communication and set a particular MAC address.

0E42    LCS     -e SNA -m 02:00:00:23:43:01 tap2

Unfortunately, that leads to:

HHC00901I 0:0E42 LCS: Interface tap2, type TAP opened
HHC00942I CTC: lcs interface tap2 using mac 82:73:1C:3A:C9:BB
HHC00943W CTC: lcs interface tap2 not using mac 02:00:00:23:43:01

Even though the message ID is different, I think the following is the relevant documentation:

HHCLC056W tapn NOT using MAC hh:hh:hh:hh:hh:hh

    Meaning
        MAC address hh:hh:hh:hh:hh:hh was requested in the configuration statement or in the OAT file for an LCS device but the operating system did not accept the request to change the MAC address for TUN/TAP device tapn. 

By the way, I start hercules as root.

Manually, i can set a MAC address for a tap interface just fine though:

$ sudo ip link tuntap add mode tap dev tap2
Command "tuntap" is unknown, try "ip link help".
$ sudo ip tuntap add mode tap dev tap2
$ sudo ip link set dev tap2 address 06:77:61:08:F1:97
$ sudo ip link show dev tap2
15: tap2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 06:77:61:08:f1:97 brd ff:ff:ff:ff:ff:ff
$ sudo ip link set dev tap2 address 02:00:00:23:43:01
$ sudo ip link show dev tap2
15: tap2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:00:00:23:43:01 brd ff:ff:ff:ff:ff:ff
$

What am I doing wrong here?

blackbit42 avatar Oct 30 '23 18:10 blackbit42

The configuration statement:-

0E42 LCS -e SNA -m 02:00:00:23:43:01 tap2

says that the LCS should use a preconfigured interface named tap2, in which case the -m option is ignored. Ideally, the configuration statement should have been rejected, and in a future it will be.

Use the ip link and ip tuntap commands you illustrated above to preconfigure the tap interface (with another ip link command to bring the tap up) before starting Hercules. To use SNA the tap interface will almost certainly have to be bridged, which generally mandates the use of a preconfigured tap interface. And preconfiguring the interface(s) means you don't have to start Hercules as root.

mcisho avatar Oct 31 '23 00:10 mcisho

Changing the configuration statement to:-

0E42 LCS -e SNA -m 02:00:00:23:43:01 -x tap2

and doing nothing else may also work. LCS should create a tap interface named tap2, and use the -m option to set the MAC address.

mcisho avatar Oct 31 '23 00:10 mcisho

Thanks for the response.

0E42    LCS     -e SNA -m 02:00:00:23:43:01 -x tap2

leads to:

HHC00916E 0:0E42 LCS: Option TAP device name value tap2 invalid
HHC00007I Previous message from function 'ParseArgs' at ctc_lcs.c(3512)
HHC01463E 0:0E42 device initialization failed
HHC00007I Previous message from function 'attach_device' at config.c(1354)

blackbit42 avatar Oct 31 '23 08:10 blackbit42