This commit is contained in:
Jeremy Janella
2026-09-10 12:46:10 -04:00
commit d3896fdb0c
4 changed files with 70 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
FROM ubuntu:22.04
WORKDIR /mininet
RUN apt update && apt install -y \
mininet \
iproute2 \
iputils-ping \
net-tools \
build-essential \
git \
sudo \
gcc \
python2 \
python-setuptools \
curl \
wget
RUN mkdir fixes \
&& cd fixes \
&& curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
&& python2 get-pip.py
RUN pip2 install twisted
RUN ln -s /usr/bin/python2 /usr/bin/python
CMD /bin/bash
+10
View File
@@ -0,0 +1,10 @@
services:
dev:
build: .
container_name: mininet
privileged: true # Required for Mininet and network namespaces
volumes:
- ./mininet:/mininet
stdin_open: true
tty: true
network_mode: "bridge"
+11
View File
@@ -0,0 +1,11 @@
# Mininet Container
Run `bash setup.sh` to create a docker container with an environment ready for mininet development.
# Usage
```
# create the container
bash setup.sh
# enter the container
docker exec -it mininet bash
```
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
echo "mininet" > .dockerignore
mkdir -p mininet
cd mininet/
echo Cloning Mininet Lab
git clone https://huangty@bitbucket.org/huangty/cs144_lab3.git 1>/dev/null 2>/dev/null
cd cs144_lab3/
git checkout --track remotes/origin/standalone 1>/dev/null 2>/dev/null
cd ..
echo Cloning Pox
git clone http://github.com/noxrepo/pox 1>/dev/null 2>/dev/null
cd pox/
git checkout f95dd1a81584d716823bbf565fa68254416af603 1>/dev/null 2>/dev/null
cd ..
sed -i '31s/.*/ router = self.addSwitch( '\''sw0'\'', protocols=["OpenFlow10"])/' cs144_lab3/lab3.py
# 'router = self.addSwitch( \'sw0\', protocols=["OpenFlow10"])'
cd ..
echo Load Open VSwitch kernel module
sudo modprobe openvswitch
docker build . # build the docker file
docker compose up -d # start the docker file
docker exec mininet /etc/init.d/openvswitch-switch start
docker exec mininet ln -s /mininet/pox /mininet/cs144_lab3/pox