-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from anarkiwi/docker
Allow starting pipette with docker-compose.
- Loading branch information
Showing
12 changed files
with
155 additions
and
91 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# pipette configuration | ||
|
||
# NOTE: system management of all pipette's interfaces should be disabled. | ||
# e.g. add denyinterfaces COPROINT, denyinterfaces BR, etc all to /etc/dhcpcd.conf | ||
|
||
# interface connected to FAUCET coprocessor port. | ||
COPROINT=lo | ||
# FAUCET VLANS where fake services will appear (space separated). | ||
VLANS=2 | ||
# addresses fake services will be run on (will be proxied from real IPs) | ||
# At the moment must be /16, and real network must be /24 (for NAT to work). | ||
# space separated. | ||
# There must be the same number of IPs in NFVIPs, as there are VLANs. | ||
NFVIPS=10.10.0.1/16 | ||
# IPv6 is also supported - must be a /64, the real network must be a /96. | ||
# NFVIPS=fc04::1/64 | ||
# interface that will be created for fake services to run on. | ||
FAKEINT=fake0 | ||
|
||
## | ||
# Optional config | ||
## | ||
|
||
# Reserved MAC addresses for fake services to use to talk to clients. | ||
FAKESERVERMAC=0e:00:00:00:00:66 | ||
FAKECLIENTMAC=0e:00:00:00:00:67 | ||
# OVS bridge name | ||
BR=copro0 | ||
# pipette OF port | ||
OF=6699 | ||
# OF port number for interface facing coprocessor | ||
COPROPORT=1 | ||
# OF port number for fake interface | ||
FAKEPORT=2 | ||
# Flag to record and location to dump pcaps | ||
RECORD=0 | ||
PCAP_LOCATION=./pcaps | ||
|
||
#pipette temporary directory | ||
PIPETTE_TEMP_DIR=/tmp/pipette |
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
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
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get -y --no-install-recommends install openvswitch-common openvswitch-switch iproute2 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY configureovs.sh /configureovs.sh | ||
ENTRYPOINT ["/configureovs.sh"] |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: "3.7" | ||
services: | ||
ovs: | ||
image: iqtlabs/openvswitch:v2.13.1 | ||
volumes: | ||
- /usr/local/var/run/openvswitch:/usr/local/var/run/openvswitch | ||
- ovs-data:/etc/openvswitch | ||
network_mode: host | ||
devices: | ||
- "/dev/net/tun:/dev/net/tun" | ||
cap_add: | ||
- NET_ADMIN | ||
pipette: | ||
image: iqtlabs/pipette:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.pipette | ||
depends_on: | ||
- ovs | ||
ports: | ||
- "${OF}:6653" | ||
environment: | ||
- FAKECLIENTMAC=${FAKECLIENTMAC} | ||
- FAKESERVERMAC=${FAKESERVERMAC} | ||
- NFVIPS=${NFVIPS} | ||
- VLANS=${VLANS} | ||
pipetteconf: | ||
restart: on-failure | ||
image: iqtlabs/pipetteconf:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.pipetteconf | ||
network_mode: host | ||
depends_on: | ||
- ovs | ||
- pipette | ||
volumes: | ||
- /usr/local/var/run/openvswitch:/var/run/openvswitch | ||
environment: | ||
- BR=${BR} | ||
- COPROINT=${COPROINT} | ||
- COPROPORT=${COPROPORT} | ||
- FAKEINT=${FAKEINT} | ||
- FAKEPORT=${FAKEPORT} | ||
- FAKECLIENTMAC=${FAKECLIENTMAC} | ||
- FAKESERVERMAC=${FAKESERVERMAC} | ||
- NFVIPS=${NFVIPS} | ||
- OF=${OF} | ||
- VLANS=${VLANS} | ||
cap_add: | ||
- NET_ADMIN | ||
volumes: | ||
ovs-data: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,2 @@ | ||
# pipette configuration | ||
|
||
# NOTE: system management of all pipette's interfaces should be disabled. | ||
# e.g. add denyinterfaces COPROINT, denyinterfaces BR, etc all to /etc/dhcpcd.conf | ||
|
||
|
||
# interface connected to FAUCET coprocessor port. | ||
COPROINT=enx0023565c8859 | ||
# addresses fake services will be run on (will be proxied from real IPs) | ||
# At the moment must be /16, and real network must be /24 (for NAT to work). | ||
# space separated. | ||
NFVIPS="10.10.0.1/16" | ||
# IPv6 is also supported - must be a /64, the real network must be a /96. | ||
# NFVIPS="fc04::1/64" | ||
# FAUCET VLANS where fake services will appear (space separated). | ||
VLANS="2" | ||
# interface that will be created for fake services to run on. | ||
FAKEINT=fake0 | ||
DFILE=Dockerfile | ||
|
||
## | ||
# Optional config | ||
## | ||
|
||
# Reserved MAC addresses for fake services to use to talk to clients. | ||
FAKESERVERMAC=0e:00:00:00:00:66 | ||
FAKECLIENTMAC=0e:00:00:00:00:67 | ||
# OVS bridge name | ||
BR=copro0 | ||
# pipette OF port | ||
OF=6699 | ||
# OF port number for interface facing coprocessor | ||
COPROPORT=1 | ||
# OF port number for fake interface | ||
FAKEPORT=2 | ||
# Flag to record and location to dump pcaps | ||
RECORD=0 | ||
PCAP_LOCATION=./pcaps | ||
|
||
#pipette temporary directory | ||
PIPETTE_TEMP_DIR=/tmp/pipette | ||
# Edit .env to make changes. | ||
source .env |
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
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