Discussion:
[hercules-390] Hercules 3.12 LCS tap binding
jln@stben.net [hercules-390]
2017-02-04 13:34:45 UTC
Permalink
Hi,
I have a problem when I try to bind Hercules 3.12 to Fedora 25.


[code]
0E20.2 LCS 10.149.85.1


14:04:22 Hercules Version 3.12
14:04:22 (c)Copyright 1999-2015 by Roger Bowler, Jan Jaeger, and others
14:04:22 Built on Feb 4 2016 at 02:51:46
...
14:04:22 HHCLC073I 0E20: TAP device tap0 opened


[***@ns conf]# ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.149.85.31 netmask 255.255.255.0 broadcast 10.149.85.255
inet6 2001:470:792a:1::2 prefixlen 64 scopeid 0x0<global>
inet6 fe80::4f:ccb1:be38:5be8 prefixlen 64 scopeid 0x20<link>
ether 00:22:4d:7c:5d:ab txqueuelen 1000 (Ethernet)
RX packets 73372 bytes 78838438 (75.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37524 bytes 4051860 (3.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xc0020000-c0040000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 74 bytes 6472 (6.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 74 bytes 6472 (6.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[***@ns conf]#
[/code]


Where is tap0?
Thanks for your help.


Bye,
Jean-Louis
Ivan Warren ivan@vmfacility.fr [hercules-390]
2017-02-04 13:46:58 UTC
Permalink
Post by ***@stben.net [hercules-390]
0E20.2 LCS 10.149.85.1
...
14:04:22 HHCLC073I 0E20: TAP device tap0 opened
Where is tap0?
Multiple possibilities :

Is hercifc setuid root ? (needed if you want hercules to configure the
interface on your behalf).
Has the program running under hercules tried to use the LCS yet ? (It's
possible the tap interface really be configured when the OS starts
accessing the LCS interface).
There are also versions of hercules (not sure which) that allow you to
pre-configure a tap instance and to bridge that tap instance to (one of)
your ethernet adapter (using brctl and openvpn to pre-create tapX)...

Just possibilities...

--Ivan


[Non-text portions of this message have been removed]
jln@stben.net [hercules-390]
2017-02-04 14:13:57 UTC
Permalink
Hi Ivan,
Thanks for your reply.


Hercifc isn't setuid root
-rwxr-xr-x 1 root root 11248 Feb 4 2016 /usr/bin/hercifc
but, hercules is working under root user.


The program can't really bind on an unknow interface.


The version that accept a preconfigured interface is 4.0 if I configure
tap0 before starting hercules it will use tap1.


Bye,
Jean-Louis
Joe Monk joemonk64@gmail.com [hercules-390]
2017-02-04 14:29:16 UTC
Permalink
http://www.hercules-390.org/herctcp.html

Joe
Post by ***@stben.net [hercules-390]
Hi Ivan,
Thanks for your reply.
Hercifc isn't setuid root
-rwxr-xr-x 1 root root 11248 Feb 4 2016 /usr/bin/hercifc
but, hercules is working under root user.
The program can't really bind on an unknow interface.
The version that accept a preconfigured interface is 4.0 if I configure
tap0 before starting hercules it will use tap1.
Bye,
Jean-Louis
jln@stben.net [hercules-390]
2017-02-04 15:00:03 UTC
Permalink
Hi Joe,
Thanks for your reply, but yes forwarding is working, hercules can, for its, initialize tun0
because it doesn't complains about it.


15:41:46 HHCLC073I 0E20: TAP device tap0 opened
15:41:46 HHCCP002I CPU0000 thread started: tid=7F58B4B76700, pid=11735, priority=15



But, in fact it didn't start it.


[***@ns log]# ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.149.85.31 netmask 255.255.255.0 broadcast 10.149.85.255
inet6 2001:470:792a:1::2 prefixlen 64 scopeid 0x0<global>
inet6 fe80::4f:ccb1:be38:5be8 prefixlen 64 scopeid 0x20<link>
ether 00:22:4d:7c:5d:ab txqueuelen 1000 (Ethernet)
RX packets 79904 bytes 79262127 (75.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 41941 bytes 4798130 (4.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xc0020000-c0040000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 74 bytes 6472 (6.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 74 bytes 6472 (6.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[***@ns log]#





[***@ns log]# ip tuntap add mode tap dev tap0
ioctl(TUNSETIFF): Device or resource busy
[***@ns log]# ip link set dev tap0 mtu 1500
[***@ns log]# ip link set dev tap0 up
[***@ns log]#



lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 74 bytes 6472 (6.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 74 bytes 6472 (6.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::90df:3eff:fe51:2a69 prefixlen 64 scopeid 0x20<link>
ether 92:df:3e:51:2a:69 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[***@ns log]#


Bye,
Jean-Louis
Ivan Warren ivan@vmfacility.fr [hercules-390]
2017-02-04 14:42:49 UTC
Permalink
Post by ***@stben.net [hercules-390]
Hi Ivan,
Thanks for your reply.
Hercifc isn't setuid root
-rwxr-xr-x 1 root root 11248 Feb 4 2016 /usr/bin/hercifc
but, hercules is working under root user
The program can't really bind on an unknow interface.
The version that accept a preconfigured interface is 4.0 if I configure
tap0 before starting hercules it will use tap1.
Bye,
Jean-Louis
Jean-Louis,


I am not sure, but I think there is an LCS option which allows the LCS
device to be bound directly to a pre-existing TAP interface (but then
instance (tap0, tap1...) needs to be specified on the LCS definition).
At this point, the LCS interface doesn't need to know the IP address
(which is only used by hercifc to create the TAP interface itself).

Again, it's possible the Network Interface is only created when the LCS
device is opened (that is proper CCW is sent) by the OS running under
hercules.

The question is : Why do you need a "tap0" interface if you are in a
bridged environment ?

Note : tapX doesn't need to be "UP" in a bridged configuration. The host
IP layer doesn't need to be UP ! The host IP layer doesn't intervene there.

--Ivan


[Non-text portions of this message have been removed]
jln@stben.net [hercules-390]
2017-02-04 15:37:02 UTC
Permalink
Hi Ivan,
Post by Ivan Warren ***@vmfacility.fr [hercules-390]
The question is : Why do you need a "tap0" interface if you are in a
bridged environment ?
I need something between the stack of the IBM OS and my Linux's stack.


Bye,
Jean-Louis
Ivan Warren ivan@vmfacility.fr [hercules-390]
2017-02-04 16:07:33 UTC
Permalink
Post by ***@stben.net [hercules-390]
Hi Ivan,
Post by Ivan Warren ***@vmfacility.fr [hercules-390]
The question is : Why do you need a "tap0" interface if you are in a
bridged environment ?
I need something between the stack of the IBM OS and my Linux's stack.
Bye,
Jean-Louis
Jean-Louis,

You need a tap0 device - not necessarily a tap0 IP network interface at
the host level. tap is a Layer 2 virtual device... That's not the same
as tun.

--Ivan


[Non-text portions of this message have been removed]
jln@stben.net [hercules-390]
2017-02-04 17:03:33 UTC
Permalink
Hi Ivan,
tap is a Layer 2 virtual device... That's not the same as tun.
I am totally lost now.


When I wrote on the IBM side :


000183 DEVICE LCS1 LCS E20
000184 ;LINK TR1 IBMTR 1 LCS1
000185 LINK ETH1 ETHERNET 0 LCS1
....
000217 HOME
000218
000219 10.149.86.1 ETH1


And on the Linux side:
[***@ns s390]# ip -4 route add 10.149.86.1 scope link dev tap0
RTNETLINK answers: Network is down
[***@ns s390]#



It's IP level at both sides.
jln@stben.net [hercules-390]
2017-02-04 17:27:19 UTC
Permalink
Hi Ivan,


Now everything is working fine but I don't know why!




tap0: flags=67<UP,BROADCAST,RUNNING> mtu 1500
inet6 fe80::4cc3:e9ff:fec7:655e prefixlen 64 scopeid 0x20<link>
ether 4e:c3:e9:c7:65:5e txqueuelen 1000 (Ethernet)
RX packets 1 bytes 60 (60.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 718 (718.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[***@ns s390]# ip -4 route add 10.149.86.1 scope link dev tap0
[***@ns s390]#


EZZ2350I MVS TCP/IP NETSTAT CS V1R10 TCPIP Name: TCPIP 18:09:37
EZZ2700I Home address list:
EZZ2701I Address Link Flg
EZZ2702I ------- ---- ---
EZZ2703I 10.149.86.1 ETH1 P
EZZ2703I 127.0.0.1 LOOPBACK
***
jln@stben.net [hercules-390]
2017-02-05 09:42:58 UTC
Permalink
Hi Ivan,
tap is a Layer 2 virtual device... That's not the same as tun.
You were totally right!
Tap transports ethernet frames and connect to the mac interface of the host.
Tun create a channel at the IP level between the IBM stack and the Linux stack.
With a tap interface the IBM virtual machine is responsible for the routing.
On the other hand with a tun interface the IBM virtual machine routes everything
to the Linux machine and it's the Linux machine that is reponsible for the routing.
But, both interfaces can be seen with ifconfig when they are on.


Thank you for your intervention.


Bye,
Jean-Louis
Ivan Warren ivan@vmfacility.fr [hercules-390]
2017-02-05 13:30:25 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...