Day: June 17, 2020
How to figure out switch and port via tcpdump
Okay if you have ever worked in a place where their network was complete choas with no documentation or network maps to help you figure out where something resides.
You can sometimes use tcpdump to help you figure out where the server is sitting by using tcpdump.
Syntax
tcpdump -nn -v -i <NIC_INTERFACE> -s 1500 -c 1 ‘ether[20:2] == 0x2000’
Example:
root@ansible:~ # tcpdump –nn -v –i eth0 -s 1500 -c 1 ‘ether[20:2] == 0x2000’
tcpdump: listening on eth3, link-type EN10MB (Ethernet), capture size 1500 bytes
03:25:22.146564 CDPv2, ttl: 180s, checksum: 692 (unverified), length 370
Device-ID (0x01), length: 11 bytes: ‘switch-sw02‘
Address (0x02), length: 13 bytes: IPv4 (1) 192.168.1.15
Port-ID (0x03), length: 15 bytes: ‘Ethernet0/1‘
Capability (0x04), length: 4 bytes: (0x00000028): L2 Switch, IGMP snooping
Version String (0x05), length: 220 bytes:
Cisco Internetwork Operating System Software
IOS ™ C2950 Software (C2950-I6Q4L2-M), Version 12.1(14)EA1a, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2003 by cisco Systems, Inc.
Compiled Tue 02-Sep-03 03:33 by Nicola tesla
Platform (0x06), length: 18 bytes: ‘cisco WS-C2950T-24’
Protocol-Hello option (0x08), length: 32 bytes:
VTP Management Domain (0x09), length: 6 bytes: ‘ecomrd‘
Duplex (0x0b), length: 1 byte: full
AVVID trust bitmap (0x12), length: 1 byte: 0x00
AVVID untrusted ports CoS (0x13), length: 1 byte: 0x00
1 packets captured
2 packets received by filter
0 packets dropped by kernel
root@ansible:~ #
Written by Nick Tailor
How to increase disk size on virtual scsi drive using gpart
Power ON VM guest after editing disk size.
![disk7](http://www.nicktailor.com/wp-content/uploads/2020/06/image2.png)
ls -d /sys/block/sd*/device/scsi_device/* |awk -F ‘[/]’ ‘{print $4,”- SCSI”,$7}’
![disk8](http://www.nicktailor.com/wp-content/uploads/2020/06/image3.png)
![disk9_1](http://www.nicktailor.com/wp-content/uploads/2020/06/image4.png)
![disk9_2](http://www.nicktailor.com/wp-content/uploads/2020/06/image5.png)
service crond stop
Note: If you observe “Device is busy” error then make sure that your current session is not in /data partition.
For GPT partition type
In this case parted -l command will give below for “sdb” disk partition
*****************************************************
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 215GB 215GB ext4 Linux LVM lvm
*****************************************************
![gpt_p](http://www.nicktailor.com/wp-content/uploads/2020/06/image6.png)
![gpt_d](http://www.nicktailor.com/wp-content/uploads/2020/06/image7.png)
![gpt_p1](http://www.nicktailor.com/wp-content/uploads/2020/06/image8.png)
![gpt_n](http://www.nicktailor.com/wp-content/uploads/2020/06/image9.png)
![gpt_p2](http://www.nicktailor.com/wp-content/uploads/2020/06/image10.png)
![gpt_w](http://www.nicktailor.com/wp-content/uploads/2020/06/image11.png)
![gpt_df](http://www.nicktailor.com/wp-content/uploads/2020/06/image12.png)