A chronological documentation test project, nothing serious, really!

13 Mar 2015 cdp by using tcpdump

If you do not have a cdp command available on your linux server, then tcpdump can be used instead.

$ sudo tcpdump -nn -v -s 1500 -c 1 'ether[20:2] == 0x2000' -i eth0

tcpdump: listening on bond1, link-type EN10MB (Ethernet), capture size 1500 bytes
08:53:01.946674 CDPv2, ttl: 180s, checksum: 692 (unverified), length 254
        Device-ID (0x01), length: 37 bytes: 'switch-name'
        Address (0x02), length: 13 bytes: IPv4 (1)
        Port-ID (0x03), length: 12 bytes: 'Ethernet1/16'
        Capability (0x04), length: 4 bytes: (0x00000228): L2 Switch, IGMP snooping
        Version String (0x05), length: 66 bytes:
          Cisco Nexus Operating System (NX-OS) Software, Version 6.0(2)N2(2)
        Platform (0x06), length: 11 bytes: 'N5K-C5548UP'
        Native VLAN ID (0x0a), length: 2 bytes: 209
        AVVID trust bitmap (0x12), length: 1 byte: 0x00
        AVVID untrusted ports CoS (0x13), length: 1 byte: 0x00
        Duplex (0x0b), length: 1 byte: full
        System Name (0x14), length: 11 bytes: 'switch-name'
        System Object ID (not decoded) (0x15), length: 14 bytes:
          0x0000:  040c 1b06 0204 0103 0d02 0102 123c
        Management Addresses (0x16), length: 13 bytes: IPv4 (1)
        Physical Location (0x17), length: 8 bytes: 0x00/switch-location
1 packets captured
16 packets received by filter
0 packets dropped by kernel

It might take up to 60 seconds before you get a result from this command.

Lines of interest
Device-ID – tells us the switch name
Port-ID – the port you are connected to
Native VLAN ID – the ports VLAN

Tags: , ,

Posted by

12 Mar 2015 Using xpra to run remote X applications

This post describes how you can run a X application on a host and view it on another.

Xpra is a tool which allows you to run X programs — usually on a remote host — and then direct their display to your local  machine, disconnect  from these programs, and reconnect from the same or another machine, all without losing any state. It differs from standard X forwarding in that it allows disconnection and reconnection without disrupting the forwarded application; it differs from  VNC and similar remote display technologies in that xpra is rootless: i.e., applications forwarded by xpra appear on your desktop as normal windows managed by your window manager, rather than being all “trapped in a box together”. Xpra also uses a custom protocol that is self-tuning and relatively latency-insensitive, and thus is usable over network connections that are too slow or unreliable for standard X forwarding. Xpra can also be used to shadow an existing X11 display.

Example to start a xpra X session and then start the X text editor gedit

$> xpra start :<DISPLAY NUMBER> && DISPLAY=:<DISPLAY NUMBER> gedit "

Example – Start geeqie

$> xpra start :100 && WINEDEBUG=-all DISPLAY=:100 geeqie &

Example using other video encoding, no audio, no clipboard

$> xpra --encoding=x264 --quality=80 --no-bell --no-speaker --no-pulseaudio --no-clipboard --no-notifications attach :100

If you combine using xpra and SSH client then you can connect to your X application from anywhere and continue you X application session.

Tags: , ,

Posted by