Skip to content

Instantly share code, notes, and snippets.

View dlbewley's full-sized avatar
📺

Dale Bewley dlbewley

📺
View GitHub Profile
@dlbewley
dlbewley / View OVS Bridge Mappings
Last active September 24, 2025 01:09
List the OVS bridge mappings associating 'localnet' networks to bridges on OpenShift Virtualization
# connect to OVN Northbound DB https://gist.github.com/dlbewley/b4d4c85931e7a9c03caf56db1a1a0d2e
$ ovncli.sh
# find local chassis id
sh-5.1# CHASSIS=`ovn-sbctl --bare --columns=name find chassis other_config:is-remote="false"`
sh-5.1# echo $CHASSIS
f57f0c4e-5d93-4639-a016-7cea61281c04
# view bridge mappings for local chassis
@dlbewley
dlbewley / .govc.env
Last active December 6, 2024 17:13
Script to recycle drives in VMware guests for OpenShift provisioning testing
# used to lookup vcenter connection details from 1Password
VAULT=development
CLUSTER=vcenter
export GOVC_USERNAME="$(op read op://${VAULT}/${CLUSTER}/username)"
export GOVC_PASSWORD="$(op read op://${VAULT}/${CLUSTER}/password)"
export GOVC_URL="$(op read op://${VAULT}/${CLUSTER}/website)"
@dlbewley
dlbewley / read-pull-secret-from-agent-iso.sh
Last active February 4, 2025 04:30
read pull secret from openshift agent based installer ISO
coreos-installer iso ignition show agent.x86_64.iso | jq -s > /tmp/agent.json
# you can read any file of course, but i wanted to verify the pull secret in this case
cat /tmp/agent.json | jq -r '.[].storage.files[] | select(.path | contains("pull-secret.yaml")) | .contents.source' | awk -F, '{print $2}' | base64 -d
  • I have a network and I want to list the ports on the ovs switch
[root@worker-4 ~]# ovs-vsctl  --columns=name,mac_in_use,mtu find interface external_ids:"k8s.ovn.org/network"="vlan-1924"
name                : "81a5ebcb6fa45_3"
mac_in_use          : "be:a0:20:9b:b1:de"
mtu                 : 1400

name                : "040cd3693b52c_3"
mac_in_use          : "c2:93:f7:05:0a:6e"
@dlbewley
dlbewley / tcpdump to verify 802.1q traffic exists on a trunk.md
Last active August 28, 2025 21:50
tcpdump to verify 802.1q traffic exists on a trunk

If you are setting up OpenShift Virt you oftent want to confirm the customer is actually sending VLAN tags to the node before troubleshooting deeper. Here is a tcpdump that can be used.

Log into the node and run toolbox to gain access to tcpdump.

  • prove 802.1q trunking is coming from the switch
[root@rhel-node-1 ~]# tcpdump -enni eth1 ether proto 0x8100 # 802.1q
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode