Friday, January 1, 2016

RHEL7:- interface configuration



ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
[root@new-host-4 ~]# nmcli connection show static
connection.id:                          static
connection.uuid:                        6ed539ad-9039-4903-8686-dd0d75896954
connection.interface-name:              ens33
connection.type:                        802-3-ethernet
connection.autoconnect:                 no
connection.autoconnect-priority:        0
connection.timestamp:                   1451691995
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:             --
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:                            manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:                         192.168.10.22/24
ipv4.gateway:                           192.168.10.1
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:                     --
[root@new-host-4 ~]# nmcli connection show static | grep -i auto
connection.autoconnect:                 no
connection.autoconnect-priority:        0
connection.autoconnect-slaves:          -1 (default)
802-3-ethernet.auto-negotiate:          yes
802-3-ethernet.mtu:                     auto
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv6.method:                            auto
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
[root@new-host-4 ~]# nmcli con mod "static" connection.autoconnect yes
[root@new-host-4 ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.22  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe80:c1d2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:80:c1:d2  txqueuelen 1000  (Ethernet)
        RX packets 5118  bytes 1001886 (978.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 194  bytes 28144 (27.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@new-host-4 ~]# nmcli con up best
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkMana                 ger/ActiveConnection/9)
[root@new-host-4 ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.11  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe80:c1d2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:80:c1:d2  txqueuelen 1000  (Ethernet)
        RX packets 5130  bytes 1004593 (981.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 212  bytes 30869 (30.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@new-host-4 ~]# nmcli connection up static
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkMana                 ger/ActiveConnection/10)
[root@new-host-4 ~]# nmcli con mod static ipv4.dns 192.168.10.110
[root@new-host-4 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search home
nameserver 192.168.10.1
[root@new-host-4 ~]# nmcli mod static +ipv4.dns 8.8.8.8
Error: Object 'mod' is unknown, try 'nmcli help'.
[root@new-host-4 ~]# nmcli con mod static +ipv4.dns 8.8.8.8
[root@new-host-4 ~]# nmcli con mod static ipv4.addresses "192.168.10.222/24 192.16                 8.10.1"
Error: failed to modify ipv4.addresses: invalid prefix '24 192.168.10.1'; <1-32> a                 llowed.
[root@new-host-4 ~]# nmcli con mod static ipv4.addresses "192.168.10.222/24  192.168.10.1"         Error: failed to modify ipv4.addresses: invalid prefix '24  192.168.10.1'; <1-32> allowed.
[root@new-host-4 ~]# nmcli con mod static ipv4.addresses "192.168.10.222 255.255.255.0  192.168.10.1"
Error: failed to modify ipv4.addresses: invalid IP address: Invalid IPv4 address '192.168.10.222 255.255.255.0  192.168.10.1'.
[root@new-host-4 ~]# nmcli con mod static ipv4.addresses "192.168.10.122/24  192.168.10.1"         Error: failed to modify ipv4.addresses: invalid prefix '24  192.168.10.1'; <1-32> allowed.
[root@new-host-4 ~]# nmcli con mod static ipv4.addresses "192.168.10.122/24"
[root@new-host-4 ~]# nmcli con status static
Usage: nmcli connection { COMMAND | help }

COMMAND := { show | up | down | add | modify | edit | delete | reload | load }

  show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...

  up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file <file with passwords>]

  down [id | uuid | path | apath] <ID> ...

  add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS

  modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+

  edit [id | uuid | path] <ID>
  edit [type <new_con_type>] [con-name <new_con_name>]

  delete [id | uuid | path] <ID>

  reload

  load <filename> [ <filename>... ]

Error: 'status' is not valid 'connection' command.
[root@new-host-4 ~]# nmcli dev status static
Unknown parameter: static
DEVICE      TYPE      STATE         CONNECTION
virbr0      bridge    connected     virbr0
ens33       ethernet  connected     static
ens37       ethernet  connected     Wired connection 1
virbr0-nic  ethernet  disconnected  --
lo          loopback  unmanaged     --
[root@new-host-4 ~]# nmcli dev status static ens33
Unknown parameter: static
Unknown parameter: ens33
DEVICE      TYPE      STATE         CONNECTION
virbr0      bridge    connected     virbr0
ens33       ethernet  connected     static
ens37       ethernet  connected     Wired connection 1
virbr0-nic  ethernet  disconnected  --
lo          loopback  unmanaged     --
[root@new-host-4 ~]# nmcli con up static
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/11)
[root@new-host-4 ~]# nmcli dev status static ens33
Unknown parameter: static
Unknown parameter: ens33
DEVICE      TYPE      STATE         CONNECTION
virbr0      bridge    connected     virbr0
ens33       ethernet  connected     static
ens37       ethernet  connected     Wired connection 1
virbr0-nic  ethernet  disconnected  --
lo          loopback  unmanaged     --
[root@new-host-4 ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.122  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe80:c1d2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:80:c1:d2  txqueuelen 1000  (Ethernet)
        RX packets 5326  bytes 1044006 (1019.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 289  bytes 41901 (40.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@new-host-4 ~]# list all devices (interfaces)^C
[root@new-host-4 ~]# nmcli dev status
DEVICE      TYPE      STATE         CONNECTION
virbr0      bridge    connected     virbr0
ens33       ethernet  connected     static
ens37       ethernet  connected     Wired connection 1
virbr0-nic  ethernet  disconnected  --
lo          loopback  unmanaged     --
[root@new-host-4 ~]# list all connections^C
[root@new-host-4 ~]# nmcli connection show
NAME                UUID                                  TYPE            DEVICE
Wired connection 2  14060a87-3977-46fe-a350-6ec3948627c2  802-3-ethernet  --
Wired connection 1  07fdc26a-ec57-427e-a877-8bacc8893ecd  802-3-ethernet  ens37
ens33               eaa62a4e-fb5c-4461-983a-58bad6f8cbf7  802-3-ethernet  --
static              6ed539ad-9039-4903-8686-dd0d75896954  802-3-ethernet  ens33
best                64c78344-15dd-442e-bc69-25c5bf2c1b6b  802-3-ethernet  --
virbr0              b53ef7bb-7c98-4d88-9dc5-64cdab8f1bad  bridge          virbr0
[root@new-host-4 ~]# list only active connections
bash: list: command not found...
[root@new-host-4 ~]# nmcli con up ens33
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)
[root@new-host-4 ~]# activate a connection
bash: activate: command not found...
[root@new-host-4 ~]# nmcli con up ens33
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/13)
[root@new-host-4 ~]# de-activate a connection^C
[root@new-host-4 ~]# nmcli con down static
Error: 'static' is not an active connection.
Error: no active connection provided.
[root@new-host-4 ~]# nmcli con down best
Error: 'best' is not an active connection.
Error: no active connection provided.
[root@new-host-4 ~]# nmcli con down ens33
Connection 'ens33' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/13)
[root@new-host-4 ~]# bringdown the interface and disable autoconnect^C
[root@new-host-4 ~]# nmcli dev disconnect ens33
Device 'ens33' successfully disconnected.
[root@new-host-4 ~]# disable all managed interfaces
bash: disable: command not found...
[root@new-host-4 ~]# nmcli net off
[root@new-host-4 ~]# Enable all managed interfaces
[root@new-host-4 ~]# nmcli net on

[root@new-host-4 ~]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.122  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe80:c1d2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:80:c1:d2  txqueuelen 1000  (Ethernet)
        RX packets 5717  bytes 1099802 (1.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 645  bytes 202638 (197.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.9  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe80:c1dc  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:80:c1:dc  txqueuelen 1000  (Ethernet)
        RX packets 14854  bytes 1909941 (1.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7451  bytes 2775734 (2.6 MiB)
        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 64  bytes 5440 (5.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5440 (5.3 KiB)
        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

virbr0-nic: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:ec:67:76  txqueuelen 500  (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@new-host-4 ~]#

[root@new-host-4 ~]#  nmcli con del ens33^C


 456  ls -l /etc/sysconfig/network-scripts/
  457  pwd
  458  cd /etc/sysconfig/network-scripts/
  459  pwd
  460  ls
  461  ls -l *ens*
  462  ifconfig -a
  463  ls
  464  more ifup-wireless
  465    ls
  466  ls -ltr
  467  more ifcfg-ens33
  468  htrp ens37 *
  469  grep ens37 *
  470  grep ens33 *
  471  nmcli con show
  472  ls
  473  nmcli con show
  474  nmcli con show --active
  475  nmcli con show -a
  476  man nm_settings
  477  man nm-settings
  478  nmcli con show "Wired connection"
  479  nmcli con show "Wired connection 1"
  480  nmcli dev status
  481  nmcli device show ens37
  482  nmcli dev show ens37
  483  nmcli net on
  484  ifconfig -a
  485  history
[root@new-host-4 ~]#




[root@new-host-4 ~]# nslookup ashok.expanor.local
Server:         192.168.10.110
Address:        192.168.10.110#53

Name:   ashok.expanor.local
Address: 192.168.10.122

[root@new-host-4 ~]# hostnamectl set-hostname ashok.expanor.local
[root@new-host-4 ~]# hostname
ashok.expanor.local
[root@new-host-4 ~]# hostnamectl status
   Static hostname: ashok.expanor.local
         Icon name: computer-vm
           Chassis: vm
        Machine ID: c52adc6d406d4d69904cf8ef9afbaf4a
           Boot ID: 1439f42e91ca4645991e8aaf4d51ed6d
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-327.el7.x86_64
      Architecture: x86-64
[root@new-host-4 ~]# cat /etc/hostname
ashok.expanor.local
[root@new-host-4 ~]#



No comments:

Post a Comment