Skip to content

Instantly share code, notes, and snippets.

View nerdalert's full-sized avatar
🐈
🦀 🐿

Brent Salisbury nerdalert

🐈
🦀 🐿
View GitHub Profile

Upgrade the default CentOS / RHEL 2.6 kernel from 2001 :/

Required due to a Devmapper issue if I recall correctly, from a 5+ yr old kernel.

$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
$ yum --enablerepo=elrepo-kernel install kernel-lt -y
$ sudo sed -i 's/^default=1/default=0/' /etc/grub.conf
$ reboot
@nerdalert
nerdalert / Docker_ENV_Volumes.md
Last active September 22, 2015 06:14
Docker Volume and Environmentals Examples

1st Example - Docker ENVs

# Dockerfile for ENV Examples
FROM busybox

ENV NAME world
CMD echo "Hello, ${NAME}! Here are the current paths --> ${PATH}"

MacVlan Example

Macvlan can be attractive because it is bridgeless.

add two namespaces

ip netns add ns1
ip netns add ns2
@nerdalert
nerdalert / rpc.json
Last active December 19, 2015 16:59
{"Port":{"columns":["fake_bridge","interfaces","name","tag"]},"Controller":{"columns":[]},"Interface":{"columns":["name"]},"Open_vSwitch":{"columns":["bridges","cur_cfg"]},"Bridge":{"columns":["controller","fail_mode","name","ports"]}}

Linux Networking Veth Pair Namespace Sausage Factory

Summary

This is a simple example of namespace networking.

  • Create 4 different namespaces and assign an ip address to each side of the veth pair
@nerdalert
nerdalert / Ipvlan_Example.md
Last active January 29, 2016 18:21
Ipvlan L2 CLI Example

Ipvlan L2 CLI Example

# add the namespaces
ip netns add ns1
ip netns add ns2

ip link add iv1 link eth0 type ipvlan mode l2
ip link add iv2 link eth0 type ipvlan mode l2

Verbose Macvlan Docker Driver Output

See repo README for more details

  1. Host iface eth0 is the parent interface for the macvlan network:
# 1. Start Docker
    $ docker daemon
#!/bin/sh
#
# Fixes the Vmware Fusion hgfs shared drive mounts not working with tested kernels 4.0-4.3
#
git clone https://github.com/rasa/vmware-tools-patches.git
sleep 1
cd vmware-tools-patches
# 8.0.0 is the fusion ver. Change to to whatever fusion version you ahve
./download-tools.sh 8.0.0
  1. Pre-req: docker daemon -D running with no networks that will overlap with tests. Pretty much 192.168.0.0/16 and the PR #964 compiled with experimental Docker or download this docker experimental binary including the drivers: docker-1.11.0-dev.zip.

  2. Pull script and give it executable permissions:

curl -o vlan-tests.sh \
    https://raw.githubusercontent.com/nerdalert/dotfiles/master/ipvlan-macvlan-it.sh && \ 
    chmod +x vlan-tests.sh
  • View the test output here
  • Host configuration is two interfacces:
$ ip a show eth0
   eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
       link/ether 00:50:56:2b:29:40 brd ff:ff:ff:ff:ff:ff
       inet 172.16.86.151/24 brd 172.16.86.255 scope global eth0
       
$ ip a show eth1