Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate IXPs from Quagga to FRR #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update docker file to use FRR instead of quagga
Belthazaar committed Nov 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3132692d268d1bc2d2b349bb2c68877f2ae33d1b
90 changes: 31 additions & 59 deletions platform/docker_images/ixp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,63 +1,35 @@
FROM ubuntu:xenial
FROM d_base_supervisor:latest

RUN apk add --no-cache openssh-server openvswitch frr frr-rpki frr-pythontools \
&& ssh-keygen -A \
&& sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config \
&& sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config \
# Unlocks the root user so that ssh login is allowed.
&& sed -i s/root:!/"root:*"/g /etc/shadow \
&& mkdir -p /var/run/sshd /root/.ssh \
&& chmod 0755 /var/run/sshd

RUN install -m 755 -o frr -g frr -d /var/log/frr \
&& install -m 755 -o frr -g frr -d /var/run/frr \
&& install -m 775 -o frr -g frrvty -d /etc/frr \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf \
&& install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf \
&& install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf \
&& echo "export VTYSH_PAGER=more" >> /etc/bash.bashrc \
&& echo "VTYSH_PAGER=more" >> /etc/environment

# Install dependencies
RUN apt-get update && apt-get install -y curl wget openvswitch-switch openvswitch-common \
vim openssh-server inetutils-traceroute net-tools tcpdump quagga \
&& rm -rf /var/lib/apt/lists/*

RUN echo "export VTYSH_PAGER=more" >> /etc/bash.bashrc
RUN echo "VTYSH_PAGER=more" >> /etc/environment

RUN touch /etc/quagga/bgpd.conf && \
touch /etc/quagga/ospfd.conf && \
touch /etc/quagga/vtysh.conf && \
touch /etc/quagga/zebra.conf


# Add startup script and set it as entrypoint
ADD docker-start /usr/sbin/docker-start
COPY looking_glass.sh /home/.looking_glass.sh
RUN chmod +x /usr/sbin/docker-start
ENTRYPOINT ["/usr/sbin/docker-start"]

# Draft for dockerfile using frr instead of quagga.
# FROM d_base_supervisor:latest

# RUN apk add --no-cache openssh-server openvswitch frr frr-rpki frr-pythontools \
# && ssh-keygen -A \
# && sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config \
# && sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config \
# # Unlocks the root user so that ssh login is allowed.
# && sed -i s/root:!/"root:*"/g /etc/shadow \
# && mkdir -p /var/run/sshd /root/.ssh \
# && chmod 0755 /var/run/sshd

# RUN install -m 755 -o frr -g frr -d /var/log/frr \
# && install -m 755 -o frr -g frr -d /var/run/frr \
# && install -m 775 -o frr -g frrvty -d /etc/frr \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf \
# && install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf \
# && install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf \
# && echo "export VTYSH_PAGER=more" >> /etc/bash.bashrc \
# && echo "VTYSH_PAGER=more" >> /etc/environment

# # RUN echo "export VTYSH_PAGER=more" >> /etc/bash.bashrc \
# # && echo "VTYSH_PAGER=more" >> /etc/environment \
# # && touch /etc/quagga/bgpd.conf \
# # && touch /etc/quagga/ospfd.conf \
# # && touch /etc/quagga/vtysh.conf \
# # && touch /etc/quagga/zebra.conf

# COPY supervisord.conf /etc/supervisor/conf.d/processes.conf
# COPY run_frr.sh /usr/local/bin/run_frr
# COPY run_ovs.sh /usr/local/bin/run_ovs
COPY supervisord.conf /etc/supervisor/conf.d/processes.conf
COPY run_frr.sh /usr/local/bin/run_frr
COPY run_ovs.sh /usr/local/bin/run_ovs

# RUN chmod +x /usr/local/bin/run_frr /usr/local/bin/run_ovs
RUN chmod +x /usr/local/bin/run_frr /usr/local/bin/run_ovs
3 changes: 3 additions & 0 deletions platform/docker_images/ixp/run_ovs.sh
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ sleep 2
ovs-vsctl add-br IXP
ovs-ofctl add-flow IXP action=NORMAL

chmod 0755 /home/.looking_glass.sh
/home/.looking_glass.sh &

# Loop while the daemons are alive.
# status returns exit code 0 only if all daemons are are running.
while $command status > /dev/null ; do