A term project for the CSE471 course, allows for P2P file sharing between peers in a network. The network is populated by containers running Alpine Linux. To bridge communication between the Docker network and the local machine, a MacVLAN network is utilized.
- Java 17
- Docker & Docker Compose
sudo docker network prunesudo ip link add macvlan_bridge link wlp0s20f3 type macvlan mode bridge
sudo ip addr add 10.22.249.100/24 dev macvlan_bridge
sudo ip link set macvlan_bridge upSubstitute wlp0s20f3 with your networking interface, which can be found via command:
ip link show
10.22.249.199/24 is a local IP address, ensure that it doesn't conflict with other devices within the network.
docker-compose up --buildThis initializes three peers running on Alpine Linux, as well as the MacVLAN network.
If necessary, adjust the number of peers, as well as your gateway and subnet addresses (find them via ip route), in the docker-compose.yml file!
- MacVLAN does not persist across sessions, so make sure to repeat its initialization.
- If network bridging does not work, consider:
- disabling ufw via
sudo ufw disable, - freeing up the ports 4113 and 4114 (my lucky numbers!),
- and pinging the containers from the local machine and vice versa:
- From local machine:
ping 10.22.249.201toping 10.22.249.203 - From container:
docker exec -it peer1 ping 10.22.249.100
- From local machine:
- disabling ufw via