Q6. We have four app server from app01 to app04
. You can access each app from jump host
using command ssh app01
and similarly for other apps. Assign new IPs to each host as per details given below:
a. Assign 172.16.238.15/24
ip address to app01
b. Assign 172.16.238.16/24
ip address to app02
c. Assign 172.16.239.15/24
ip address to app03
d. Assign 172.16.239.16/24
ip address to app04
e. We also need to remove existing IPs from these apps after assigning them new IPs but do not remove them right now as it can break your connection.
My attempt:
Last login: Sun Oct 29 03:17:36 UTC 2023 on pts/0
thor@jump_host ~$ ssh app01
The authenticity of host ‘app01 (172.16.238.11)’ can’t be established.
ECDSA key fingerprint is SHA256:QQVfDSo+jdI/dPgI9przO0S2IThITyLAGhslY0zINlI.
ECDSA key fingerprint is MD5:bf:a1:b2:a1:89:a1:fb:63:18:f0:2e:fb:ed:5c:06:a0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘app01,172.16.238.11’ (ECDSA) to the list of known hosts.
[thor@app01 ~]$ sudo ip addr add 172.16.238.15/24 dev eth0
[thor@app01 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
19: eth0@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:10:ee:0b brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.16.238.11/24 brd 172.16.238.255 scope global eth0
valid_lft forever preferred_lft forever
inet 172.16.238.15/24 scope global secondary eth0
valid_lft forever preferred_lft forever
27: eth1@if28: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:07 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.7/16 brd 172.17.255.255 scope global eth1
valid_lft forever preferred_lft forever
[thor@app01 ~]$ sudo ip addr del 172.16.238.255 dev eth0
Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (172.16.238.255/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!
RTNETLINK answers: Cannot assign requested address
[thor@app01 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
19: eth0@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:10:ee:0b brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.16.238.11/24 brd 172.16.238.255 scope global eth0
valid_lft forever preferred_lft forever
inet 172.16.238.15/24 scope global secondary eth0
valid_lft forever preferred_lft forever
27: eth1@if28: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:07 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.7/16 brd 172.17.255.255 scope global eth1
valid_lft forever preferred_lft forever
[thor@app01 ~]$ sudo ip addr del 172.16.238.11/24 dev eth0
ISSUE:
Here, the terminal is stuck like this