This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Setup a Fedora 21 VM using virt-builder and import into virt-manager. | |
2. Download and compile https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.tar.xz with CONFIG_IPVLAN=m. | |
3. Copy the kernel to /boot and add it to grub using grub2-mkconfig and dracut. Reboot. | |
4. Steps from https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvlan.txt with additional comments -- | |
(a) Create two network namespaces - ns0, ns1 | |
ip netns add ns0 | |
ip netns add ns1 | |
(b) Create two ipvlan slaves on eth0 (master device) | |
ip link add link eth0 ipvl0 type ipvlan mode l2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x | |
network_ip=10.1.0.0/16 | |
tap_ip=10.1.0.1 | |
new_ip=$1 | |
net_container=$(docker run -d kubernetes/pause) | |
echo $net_container | |
pid=$(docker inspect --format "{{.State.Pid}}" ${net_container}) | |
ipaddr=$(docker inspect --format "{{.NetworkSettings.IPAddress}}" ${net_container}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package system_test | |
import ( | |
"io/ioutil" | |
"os" | |
"testing" | |
"github.com/docker/libcontainer/system" | |
"github.com/docker/libcontainer/selinux" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sched.h> | |
#include <errno.h> | |
#include <sys/mount.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "v1beta2", | |
"desiredState": { | |
"manifest": { | |
"containers": [ | |
{ | |
"image": "kubernetes/pause", | |
"name": "hello-container1", | |
"ports": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unshare -Urm --mount-proc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read line | |
do | |
echo $line > /tmp/myoutput | |
done < /dev/stdin | |
mkdir -p /var/log/journal/9876 | |
mkdir -p /busybox/var/log/journal/9876 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
umount /busybox/var/log/journal/9876 | |
rm -rf /var/log/journal/9876 | |
umount /busybox/etc/machine-id | |
rm -rf /busybox/etc/machine-id | |
rm -rf /tmp/busybox/etc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/hex" | |
"flag" | |
"log" | |
"github.com/godbus/dbus" | |
) |