This repository contains a set of scripts designed to streamline the following tasks:
- Packet Forwarding: Forward packets from the
10.1.0.0/16subnet through an agent gateway VM (named "agent"). - NGINX Initialization & Configuration: Initialize and configure NGINX on your server.
- Dynamic IP Updates: Periodically update NGINX configurations with the current server IP via a cron job.
-
agent_vm_linux.ps1
A PowerShell script tailored for Linux users to forward packets through the agent gateway VM. -
agent_vm_ulm.ps1
An updated version of the PowerShell script for packet forwarding through the agent gateway VM.
-
init_nginx.sh
A shell script to initialize and configure NGINX on your server. -
update_srv_ip.sh
A shell script intended to be scheduled as a cron job. It dynamically retrieves the server's IP address and updates the NGINX configuration accordingly.
Depending on your operating environment, execute the appropriate script:
-
For Linux Users:
Run the PowerShell scriptagent_vm_linux.ps1using PowerShell on Linux. -
For PowerShell Users:
Run the updated scriptagent_vm_ulm.ps1in your PowerShell environment.
Note: Ensure your network is configured to forward packets from the
10.1.0.0/16subnet to the agent gateway VM.
To set up NGINX, execute the following commands in your terminal:
curl -o init_nginx.sh https://ulm.ahmed-yehia.me/init_nginx && \
chmod +x init_nginx.sh && sudo ./init_nginx.sh && \
curl -o update_srv_ip.sh https://ulm.ahmed-yehia.me/update_srv_ip && \
chmod +x update_srv_ip.sh && sudo ./update_srv_ip.shTo set up the agent VM script using PowerShell:
curl -o agent_vm_ulm.ps1 https://ulm.ahmed-yehia.me/setup_agent_vm && \
pwsh -ExecutionPolicy Bypass -File ./agent_vm_ulm.ps1Deployment Diagram
A deployment diagram is provided above to visually illustrate the packet forwarding process through the agent gateway VM and the integration with NGINX.
Contributing
Contributions, bug reports, and feature requests are welcome! Please feel free to open an issue or submit a pull request.
