Connecting to wifi through command prompt in Linux (nmcli)

To connect to wifi with a password

#nmcli d wifi conn MyWifi password ‘xxxxxxx’ iface wlan0

MyWifi is SSID name, replace this with your wifi name (SSID name). Keep your password in place of ‘xxxxxx’

wlan0 interface for wifi network, this you can find with ifconfig command or nmcli command.

To disconnect wifi

# nmcli d disconnect iface wlan0

To see network status

# nmcli d status
DEVICE     TYPE              STATE
eth0       802-3-ethernet    unavailable
wlan0      802-11-wireless   disconnected

To See list of available wifi networks

#nmcli d list

nmcli has 3 OBJECTs
nm              NetworkManager’s status
c[onnection]    NetworkManager’s connections
d[evice]        devices managed by NetworkManager

1. Network Manager (nm)

(COMMAND := { status | permissions | enable | sleep | wifi | wwan }
# nmcli nm status
RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN
running         disconnected    enabled         enabled    enabled         enabled

# nmcli nm wifi off

# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
BROADCAST MULTICAST  MTU:1500  Metric:1
RX packets:95213298 errors:0 dropped:0 overruns:0 frame:0
TX packets:87755319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88153431076 (88.1 GB)  TX bytes:73877643984 (73.8 GB)

# nmcli nm wifi on

# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
UP BROADCAST MULTICAST  MTU:1500  Metric:1
RX packets:95213298 errors:0 dropped:0 overruns:0 frame:0
TX packets:87755319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88153431076 (88.1 GB)  TX bytes:73877643984 (73.8 GB)

2. Network Managers Connection (c)

(COMMAND := { list | status | up | down | delete })

How to list available network manager connections

#nmcli c list

How to delete one of the network manager connection from the list using uuid

# nmcli c delete uuid 58be4adb-a360-46cc-xxxx-8868a8cfxxxx

3. Network device (d)

Advertisements

How to check if Linux has Fibre card installed or not?

 
How to check if Linux box has f Fibre card installed or not…. Below are few methods that, you can tell end user if underline Linux server has Fibre card installed.

# lspci | grep -i emulex
0b:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)

<<<< For more details like the speed card is operating etc >>>>

# lspci -vv | less
Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
Subsystem: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR- FastB2B-

Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Latency: 0, Cache Line Size 10
Interrupt: pin A routed to IRQ 217
Region 0: Memory at f9ff0000 (64-bit, non-prefetchable) [size=4K]
Region 2: Memory at f9fe0000 (64-bit, non-prefetchable) [size=256]
Region 4: I/O ports at 4000 [size=256]
Capabilities: [58] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [60] Message Signalled Interrupts: 64bit+ Queue=0/4 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [44] Express Endpoint IRQ 0
Device: Supported: MaxPayload 2048 bytes, PhantFunc 0, ExtTag+
Device: Latency L0s <4us, L1 <16us
Device: AtnBtn- AtnInd- PwrInd-
Device: Errors: Correctable- Non-Fatal+ Fatal+ Unsupported-
Device: RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
Device: MaxPayload 512 bytes, MaxReadReq 4096 bytes
Link: Supported Speed 2.5Gb/s, Width x4, ASPM L0s, Port 0
Link: Latency L0s <4us, L1 unlimited
Link: ASPM Disabled RCB 64 bytes CommClk- ExtSynch-
Link: Speed 2.5Gb/s, Width x4
Capabilities: [100] Advanced Error Reporting
Capabilities: [12c] Power Budgeting

<<<< You can check if required driver is installed or not >>>>

# dmesg | grep -i emulex
Emulex LightPulse Fibre Channel SCSI driver 8.0.16.34
Copyright(c) 2003-2007 Emulex. All rights reserved.

Another way to check this out is check for /proc/scsi

Fibre channel is visible in the /proc/scsi hierarchy, but the exact path depends on the manufacturer (Emulex, Qlogic) of the Fibre Channel adapter + device driver. in my case it is as below –

# ls -l /proc/scsi/lpfc/0
-rw-r–r– 1 root root 0 Sep 10 03:36 /proc/scsi/lpfc/0

Yet another option is to check if kernel module is installed or not

# lsmod | grep -i lpfc
lpfc 170561 0
scsi_transport_fc 12353 1 lpfc
scsi_mod 120269 5 scsi_dump,lpfc,scsi_transport_fc,cciss,sd_mod

 
Reference:

RHEL6 features

1. It uses UUID instead of labels for the disks

which means in /etc/fstab you will mention UUID=”xsdfdfs123sdf” /mnt ext4 defaults 1 2

you do not need e2label command any more, but you need blkid command, using command you will find uuid of a partition.

2. After creating new partition you have to reboot the system to updated kernel partition table or use commands “partprobe or kpartx” to update kernel partition table.

3. RHEL6 uses two new strong password hasingh i.e. SHA-256 (algorithm 5) and SA-512 (algorithm 6)

4. Default Mail Transfer Agent (SMTP server) is PostFix not Sendmail

5. System Security Services Daemon (SSSD) implements a set of services for central management of identity and authentication.

–Note these are few features I noticed

puppet – configuration management tool

Puppet is a tool designed to manage the configuration of Unix-like and Microsoft Windows systems declaratively. The user describes system resources and their state, either using Puppet’s declarative language or a Ruby DSL (domain-specific language). This information is stored in files called “Puppet manifests”. Puppet discovers the system information via a utility called Facter, and compiles the Puppet manifests into a system-specific catalog containing resources and resource dependency, which are applied against the target systems. Any actions taken by Puppet are then reported. more

Video which gives demo on puppet