Tuesday, March 21, 2017

RHCE-Network Configuration using nmcli

login as: kamal
kamal@192.168.10.17's password:
Last login: Sun Mar 12 08:21:56 2017 from 192.168.10.5
su -[kamal@bishal ~]$ su -
Password:
Last login: Fri Mar 17 21:28:12 EDT 2017 on pts/0
[root@bishal ~]# pwd
/root
[root@bishal ~]# clear
[root@bishal ~]# nmcli con show
NAME                UUID                                  TYPE            DEVICE
static              40b2dffc-b807-4c51-9ae2-dd26b2abba40  802-3-ethernet  --
static              e339c10c-6524-45bb-8537-b9c8bace48cf  802-3-ethernet  --
eno16777736         cbcb24fd-db89-4e88-b53a-273e2b80659e  802-3-ethernet  --
static              3042a353-055b-4dcf-8c01-e2543bf2afcd  802-3-ethernet  --
deafault1           ee927e60-8436-45e6-9f86-46a39908fbda  802-3-ethernet  --
static              5e7384cb-74df-4966-aa4b-1238f8695a15  802-3-ethernet  --
default             ea5ad6f6-a322-426f-a2f8-f9ef5bc645f1  802-3-ethernet  eno16777736
static              f3448082-eec2-4439-baef-82808245bd69  802-3-ethernet  --
defult              54dc9db9-d3ac-485c-b767-9526a34b6de1  802-3-ethernet  --
default             59c13a88-176f-4d3a-b3f8-7ca41ac1ef70  802-3-ethernet  --
Wired connection 2  e7114d14-9538-4c99-91e7-e42c0211c59d  802-3-ethernet  eno33554984
virbr0              bb98c72c-ac1f-4ffa-9074-3b2cb1108b5d  bridge          virbr0
Wired connection 1  4c50e87a-c5fe-436b-b332-28b1021d6d09  802-3-ethernet  --
[root@bishal ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.17  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe14:82bc  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:14:82:bc  txqueuelen 1000  (Ethernet)
        RX packets 166480  bytes 247747034 (236.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27267  bytes 3453267 (3.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno33554984: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.25  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe14:82c6  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:14:82:c6  txqueuelen 1000  (Ethernet)
        RX packets 147  bytes 15885 (15.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26  bytes 4477 (4.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

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 0  (Local Loopback)
        RX packets 8  bytes 680 (680.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 680 (680.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 00:00:00:00:00:00  txqueuelen 0  (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

[root@bishal ~]# nmcli connection show "Wired connection 2"
connection.id:                          Wired connection 2
connection.uuid:                        e7114d14-9538-4c99-91e7-e42c0211c59d
connection.interface-name:              --
connection.type:                        802-3-ethernet
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.timestamp:                   1489843309
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          yes
802-3-ethernet.mac-address:             00:0C:29:14:82:C6
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:
802-3-ethernet.wake-on-lan:             1 (default)
802-3-ethernet.wake-on-lan-password:    --
ipv4.method:                            auto
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:
ipv4.gateway:                           --
ipv4.routes:
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            auto
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.gateway:                           --
ipv6.routes:
ipv6.route-metric:                      -1
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
GENERAL.NAME:                           Wired connection 2
GENERAL.UUID:                           e7114d14-9538-4c99-91e7-e42c0211c59d
GENERAL.DEVICES:                        eno33554984
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.VPN:                            no
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/3
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/12
GENERAL.SPEC-OBJECT:                    /
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         192.168.10.25/24
IP4.GATEWAY:                            192.168.10.1
IP4.DNS[1]:                             192.168.10.1
DHCP4.OPTION[1]:                        requested_domain_search = 1
DHCP4.OPTION[2]:                        requested_nis_domain = 1
DHCP4.OPTION[3]:                        requested_time_offset = 1
DHCP4.OPTION[4]:                        requested_broadcast_address = 1
DHCP4.OPTION[5]:                        requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[6]:                        requested_classless_static_routes = 1
DHCP4.OPTION[7]:                        requested_domain_name = 1
DHCP4.OPTION[8]:                        expiry = 1489929169
DHCP4.OPTION[9]:                        requested_wpad = 1
DHCP4.OPTION[10]:                       next_server = 0.0.0.0
DHCP4.OPTION[11]:                       broadcast_address = 192.168.10.255
DHCP4.OPTION[12]:                       dhcp_message_type = 5
DHCP4.OPTION[13]:                       requested_subnet_mask = 1
DHCP4.OPTION[14]:                       dhcp_lease_time = 86400
DHCP4.OPTION[15]:                       routers = 192.168.10.1
DHCP4.OPTION[16]:                       ip_address = 192.168.10.25
DHCP4.OPTION[17]:                       requested_static_routes = 1
DHCP4.OPTION[18]:                       requested_interface_mtu = 1
DHCP4.OPTION[19]:                       requested_nis_servers = 1
DHCP4.OPTION[20]:                       requested_ntp_servers = 1
DHCP4.OPTION[21]:                       subnet_mask = 255.255.255.0
DHCP4.OPTION[22]:                       domain_name_servers = 192.168.10.1
DHCP4.OPTION[23]:                       requested_ms_classless_static_routes = 1
DHCP4.OPTION[24]:                       requested_routers = 1
DHCP4.OPTION[25]:                       requested_domain_name_servers = 1
DHCP4.OPTION[26]:                       network_number = 192.168.10.0
DHCP4.OPTION[27]:                       requested_host_name = 1
DHCP4.OPTION[28]:                       dhcp_server_identifier = 192.168.10.1
IP6.ADDRESS[1]:                         fe80::20c:29ff:fe14:82c6/64
IP6.GATEWAY:
[root@bishal ~]# nmcli dev status
DEVICE       TYPE      STATE         CONNECTION
virbr0       bridge    connected     virbr0
eno16777736  ethernet  connected     default
eno33554984  ethernet  connected     Wired connection 2
virbr0-nic   ethernet  disconnected  --
lo           loopback  unmanaged     --
[root@bishal ~]# nmcli con show
NAME                UUID                                  TYPE            DEVICE
static              40b2dffc-b807-4c51-9ae2-dd26b2abba40  802-3-ethernet  --
static              e339c10c-6524-45bb-8537-b9c8bace48cf  802-3-ethernet  --
eno16777736         cbcb24fd-db89-4e88-b53a-273e2b80659e  802-3-ethernet  --
static              3042a353-055b-4dcf-8c01-e2543bf2afcd  802-3-ethernet  --
deafault1           ee927e60-8436-45e6-9f86-46a39908fbda  802-3-ethernet  --
static              5e7384cb-74df-4966-aa4b-1238f8695a15  802-3-ethernet  --
default             ea5ad6f6-a322-426f-a2f8-f9ef5bc645f1  802-3-ethernet  eno16777736
static              f3448082-eec2-4439-baef-82808245bd69  802-3-ethernet  --
defult              54dc9db9-d3ac-485c-b767-9526a34b6de1  802-3-ethernet  --
default             59c13a88-176f-4d3a-b3f8-7ca41ac1ef70  802-3-ethernet  --
Wired connection 2  e7114d14-9538-4c99-91e7-e42c0211c59d  802-3-ethernet  eno33554984
virbr0              bb98c72c-ac1f-4ffa-9074-3b2cb1108b5d  bridge          virbr0
Wired connection 1  4c50e87a-c5fe-436b-b332-28b1021d6d09  802-3-ethernet  --
[root@bishal ~]# nmcli dev show eno33554984 | more
GENERAL.DEVICE:                         eno33554984
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         00:0C:29:14:82:C6
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 2
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/3
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.10.25/24
IP4.GATEWAY:                            192.168.10.1
IP4.DNS[1]:                             192.168.10.1
IP6.ADDRESS[1]:                         fe80::20c:29ff:fe14:82c6/64
IP6.GATEWAY:
[root@bishal ~]# nmcli con add con-name "bishal-33" ifname eno33554984 type ethernet ipv4 192.168.10.30/24 gw4 192.168.10.1
Error: Unexpected argument 'ipv4'
You have new mail in /var/spool/mail/root
[root@bishal ~]# nmcli con add con-name "bishal-33" ifname eno33554984 type ethernet ip4 192.168.10.30/24 gw4 192.168.10.1
Connection 'bishal-33' (68a6099f-9011-4e07-bbb0-d38415622fe1) successfully added.
[root@bishal ~]# nmcli con show
NAME                UUID                                  TYPE            DEVICE
static              40b2dffc-b807-4c51-9ae2-dd26b2abba40  802-3-ethernet  --
static              e339c10c-6524-45bb-8537-b9c8bace48cf  802-3-ethernet  --
eno16777736         cbcb24fd-db89-4e88-b53a-273e2b80659e  802-3-ethernet  --
static              3042a353-055b-4dcf-8c01-e2543bf2afcd  802-3-ethernet  --
deafault1           ee927e60-8436-45e6-9f86-46a39908fbda  802-3-ethernet  --
static              5e7384cb-74df-4966-aa4b-1238f8695a15  802-3-ethernet  --
default             ea5ad6f6-a322-426f-a2f8-f9ef5bc645f1  802-3-ethernet  eno16777736
static              f3448082-eec2-4439-baef-82808245bd69  802-3-ethernet  --
defult              54dc9db9-d3ac-485c-b767-9526a34b6de1  802-3-ethernet  --
default             59c13a88-176f-4d3a-b3f8-7ca41ac1ef70  802-3-ethernet  --
bishal-33           68a6099f-9011-4e07-bbb0-d38415622fe1  802-3-ethernet  --
Wired connection 2  e7114d14-9538-4c99-91e7-e42c0211c59d  802-3-ethernet  eno33554984
virbr0              bb98c72c-ac1f-4ffa-9074-3b2cb1108b5d  bridge          virbr0
Wired connection 1  4c50e87a-c5fe-436b-b332-28b1021d6d09  802-3-ethernet  --
[root@bishal ~]# nmcli con show --active
NAME                UUID                                  TYPE            DEVICE
default             ea5ad6f6-a322-426f-a2f8-f9ef5bc645f1  802-3-ethernet  eno16777736
Wired connection 2  e7114d14-9538-4c99-91e7-e42c0211c59d  802-3-ethernet  eno33554984
virbr0              bb98c72c-ac1f-4ffa-9074-3b2cb1108b5d  bridge          virbr0
[root@bishal ~]# nmcli con up bishal-33
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
[root@bishal ~]# nmcli connection show --active
NAME       UUID                                  TYPE            DEVICE
default    ea5ad6f6-a322-426f-a2f8-f9ef5bc645f1  802-3-ethernet  eno16777736
bishal-33  68a6099f-9011-4e07-bbb0-d38415622fe1  802-3-ethernet  eno33554984
virbr0     bb98c72c-ac1f-4ffa-9074-3b2cb1108b5d  bridge          virbr0
[root@bishal ~]#
[kamal@pradip ~]$ grep bill /etc/passwd | cut -d ":" -f1 | tr "\n" " "
[kamal@pradip ~]$ echo ram sam sita rita| tr '[a-z]' '[A-Z]' | tr " " "\n" | tee out.out | tr "\n" " "
[kamal@pradip myjunk]$ find -name "file*" -exec cp -p {} /var/tmp/myfindings/ \;
[kamal@localhost ~]$ for server in 3 7 8 5 9 212 65
> do
> scp pravctice.txt kamal@192.168.10.$server:/var/tmp
> done
kamal@192.168.10.3's password:

[root@bishal ~]# df -h /opt/apps1/
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc1       2.0G   33M  2.0G   2% /opt/apps1
[root@bishal ~]# blkid /dev/sdc2
[root@bishal ~]# blkid
/dev/sda1: UUID="d3301139-be26-491e-ab11-67ea1548dad4" TYPE="xfs"
/dev/sda2: UUID="a41490aa-246a-41b0-a973-7b2d4fffba25" TYPE="swap"
/dev/sda3: UUID="ba44543c-834d-4847-b00d-548bc8404e64" TYPE="xfs"
/dev/sr0: UUID="2015-12-09-23-14-10-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" P                                                                                        TTYPE="dos"
/dev/sdc1: UUID="38d1894d-42ba-49a3-bc27-83a7cc35db27" TYPE="xfs"
[root@bishal ~]# blkid /dev/sdc
/dev/sdc: PTTYPE="dos"
[root@bishal ~]# blkid /dev/sdc1
/dev/sdc1: UUID="38d1894d-42ba-49a3-bc27-83a7cc35db27" TYPE="xfs"
[root@bishal ~]# blkid /dev/sdc2
[root@bishal ~]# mkfs.xfs /dev/sdc2
meta-data=/dev/sdc2              isize=256    agcount=4, agsize=196608 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=786432, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@bishal ~]# mkdir /opt/apps2
[root@bishal ~]# blkid /dev/sdc2
/dev/sdc2: UUID="57f1dbcf-b15b-4c0b-9df8-bb0a5b9ddcaa" TYPE="xfs"
[root@bishal ~]# mount UUID="57f1dbcf-b15b-4c0b-9df8-bb0a5b9ddcaa" /opt/apps2
[root@bishal ~]# echo $?
0
[root@bishal ~]# df -h /opt/apps2
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc2       3.0G   33M  3.0G   2% /opt/apps2
[root@bishal ~]# grep -E "vmx/svm" /proc/cpuinfo
[root@bishal ~]# grep -E "nx" /proc/cpuinfo

[root@bishal ~]# yum install qemu-kvm qemu-img
[root@bishal opt]# cp -a OS_Image/ /var/www/html/
[root@bishal html]# vi /etc/yum.repos.d/bishal.repo
[root@bishal html]# yum clean all
[root@bishal html]# yum repolist
[root@bishal html]# yum install qemu-kvm qemu-img
[root@makku yum.repos.d]# more my.repo
[MYREPO]
name=My CentO Repo
baseurl=file:///opt/os_image
gpgcheck=0
enabled=1

[root@makku html]# systemctl status httpd

No comments:

Post a Comment