Re: IP change for a Linux guest

2022-07-04 Thread Stefan Raspl
Note that the network management software differs by distro: RHEL uses 
NetworkManager (see Eric's answer below), SUSE uses wicked, and Ubuntu uses 
netplan - and beware: Some distros changed their tools over time: E.g. Ubuntu 
was formerly using NetworkManager at some point if I recall correctly.
Each distro has a different user interface - so please consult your distro's 
manual, they usually have a good description of such tasks.
Also, I'd recommend to setup a secondary interface and use that to perform the 
changes. With z/VM, it's really easy to setup a temporary IUCV connection 
between two guests (see small snippet below, needs to be performed on both sides 
- haven't tested it recently, but something along those lines).


$ modprobe netiucv
# Setup connection to guestB (peer)
$ echo guestB>/sys/bus/iucv/drivers/netiucv/connection
# Configure device
$ ip addr add 192.168.2.1/16 dev iucv0
$ ip link set up dev iucv0
$ ip addr show iucv0
6: iucv0:  mtu 9216 qdisc fq_codel state UNKNOWN 
group default qlen 50

link/slip
inet 192.168.3.1/16 scope global iucv0
   valid_lft forever preferred_lft forever

Ciao,
Stefan



On 6/30/22 06:00, Eric Chevalier wrote:

This is something I've done occasionally in our z/VM guests. All through
an ssh session, no less! (Note that our Linux guests are running RHEL8.)

In my case, I have a network connection called "enccw0.0.f804". I use
the "nmtui" command to make any changes to the connection definition.
Then I'll issue the command:

    nmcli conn down enccw0.0.f804 ; nmcli conn up enccw0.0.f804

The first nmcli command turns off the connection. The second nmcli
brings the connection back up, picking up the changes I made with nmtui.
Of course this will drop your connection to the original IP address,
forcing you to re-establish an ssh connection to the new IP address. You
have to stack the two nmcli commands as shown. Obviously, if you just
use the first nmcli command you'll never be able to re-establish your
ssh session.

As a "back door": if I were to issue the first nmcli command without
stacking the second, I could still get on to the Linux system by logging
on to the guest using a 3270 session. Granted, Linux doesn't support
3270 sessions very well (at least not ours). Full screen applications
like vim don't work very well on a 3270 session. But most command-line
commands that read from stdin and write to stdout/stderr do work. So
through my 3270 session I could issue the "nmcli conn up" command to
re-enable ssh sessions.

On 6/29/2022 10:15 PM, Peter wrote:

Hello

When an existing redhat Linux guest on zVM requires a IP change. What are
files that I need to change to reflect with new IP address?

For an existing Linux, how do I view it's console from a 3270 emulator ?
Cause as of due to the IP change the Linux guest is not connectable via SSH.

Could someone please guide me ?

Regards
Peter


--
Eric Chevalier
Phoenix Software International
e...@phoenixsoftware.com
Voice: (918) 491-6144 x410
  Cell: (918) 629-6393
   Fax: (918) 494-2701



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390



--

Mit freundlichen Grüßen / Kind regards

Stefan Raspl


Linux on Z
---
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-2177
E-Mail: stefan.ra...@de.ibm.com
---
IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: 
Gregor Pillen

Geschäftsführung: David 

Re: IP change for a Linux guest

2022-06-30 Thread Eric Chevalier

This is something I've done occasionally in our z/VM guests. All through
an ssh session, no less! (Note that our Linux guests are running RHEL8.)

In my case, I have a network connection called "enccw0.0.f804". I use
the "nmtui" command to make any changes to the connection definition.
Then I'll issue the command:

   nmcli conn down enccw0.0.f804 ; nmcli conn up enccw0.0.f804

The first nmcli command turns off the connection. The second nmcli
brings the connection back up, picking up the changes I made with nmtui.
Of course this will drop your connection to the original IP address,
forcing you to re-establish an ssh connection to the new IP address. You
have to stack the two nmcli commands as shown. Obviously, if you just
use the first nmcli command you'll never be able to re-establish your
ssh session.

As a "back door": if I were to issue the first nmcli command without
stacking the second, I could still get on to the Linux system by logging
on to the guest using a 3270 session. Granted, Linux doesn't support
3270 sessions very well (at least not ours). Full screen applications
like vim don't work very well on a 3270 session. But most command-line
commands that read from stdin and write to stdout/stderr do work. So
through my 3270 session I could issue the "nmcli conn up" command to
re-enable ssh sessions.

On 6/29/2022 10:15 PM, Peter wrote:

Hello

When an existing redhat Linux guest on zVM requires a IP change. What are
files that I need to change to reflect with new IP address?

For an existing Linux, how do I view it's console from a 3270 emulator ?
Cause as of due to the IP change the Linux guest is not connectable via SSH.

Could someone please guide me ?

Regards
Peter


--
Eric Chevalier
Phoenix Software International
e...@phoenixsoftware.com
Voice: (918) 491-6144 x410
 Cell: (918) 629-6393
  Fax: (918) 494-2701



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390


Re: IP change for a Linux guest

2022-06-29 Thread Cohen, Sam
Peter,

If you logon to the Linux guest via a 3270 display, you'll likely see a blank 
screen after logon (and password).  Press Enter and you'll see VM READ in the 
lower right corner of the display.  Press Enter again and you should see "Enter 
password" and RUNNING in the lower right corner of the screen.  Give it some 
time until it tires of waiting for a password and asks for a userid.  Enter a 
userid with sudo authority, or "root"; enter the password when prompted.  Once 
you're logged in, you should be able to issue an "ip" command (or an "ifconfig" 
or whatever command works for you to dynamically enter a new IP address.  
Remember to update your default gateway with a "route add" command.  You should 
then be able to ssh to the Linux guest.

When you are done with the console interface, be sure the lower right corner of 
the display does NOT display CP READ, then enter the command "logout".  Once 
you are prompted for a userid, enter the CP Break Key (key PA1 is the default), 
watch for CP READ in the lower right corner, then type "DISCONNECT" and press 
Enter.  Your physical console (the 3270 terminal) will then be disconnected 
from the virtual console, and you can go about your business.

Thanks,

Sam
(217) 862-9227 (office)
(602) 327-2134 (cell)

-Original Message-
From: Linux on 390 Port  On Behalf Of Peter
Sent: Wednesday, June 29, 2022 20:16
To: LINUX-390@VM.MARIST.EDU
Subject: IP change for a Linux guest

Hello

When an existing redhat Linux guest on zVM requires a IP change. What are files 
that I need to change to reflect with new IP address?

For an existing Linux, how do I view it's console from a 3270 emulator ?
Cause as of due to the IP change the Linux guest is not connectable via SSH.

Could someone please guide me ?

Regards
Peter

--
For LINUX-390 subscribe / signoff / archive access instructions, send email to 
lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww2.marist.edu%2Fhtbin%2Fwlvindex%3FLINUX-390data=05%7C01%7CSam.Cohen%40LRS.COM%7C46dc80e5daa44e41f34908da5a472e55%7C62af9ccc42164ae2a1d306614c59c315%7C1%7C0%7C637921559055544780%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=Os1EcNQi9oHXu3dRCdfcmNoUZDtwOKAPsS%2BNUTw6Ri8%3Dreserved=0

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390