All Projects → saschpe → Libvirt Hook Qemu

saschpe / Libvirt Hook Qemu

Libvirt hook for setting up iptables port-forwarding rules when using NAT-ed networking.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Libvirt Hook Qemu

Brutusin Rpc
Self-describing JSON-RPC web services over HTTP, with automatic API description based on JSON-Schema
Stars: ✭ 36 (-73.72%)
Mutual labels:  json-schema, json
Jsonschema Key Compression
Compress json-data based on its json-schema while still having valid json
Stars: ✭ 59 (-56.93%)
Mutual labels:  json-schema, json
Uvicorn Gunicorn Fastapi Docker
Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python 3.6 and above with performance auto-tuning. Optionally with Alpine Linux.
Stars: ✭ 1,014 (+640.15%)
Mutual labels:  json-schema, json
Movement
Movement is an easier, simpler way to explore and use NIEM. Want to join the Movement and contribute to it? Start here.
Stars: ✭ 19 (-86.13%)
Mutual labels:  json-schema, json
React Jsonschema Form
A React component for building Web forms from JSON Schema.
Stars: ✭ 10,870 (+7834.31%)
Mutual labels:  json-schema, json
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+539.42%)
Mutual labels:  json-schema, json
Univalue
High performance RAII C++ JSON library and universal value object class
Stars: ✭ 46 (-66.42%)
Mutual labels:  json-schema, json
Full Stack Fastapi Postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Stars: ✭ 7,635 (+5472.99%)
Mutual labels:  json-schema, json
Json Node Normalizer
'json-node-normalizer' - NodeJS module that normalize json data types from json schema specifications.
Stars: ✭ 105 (-23.36%)
Mutual labels:  json-schema, json
Avocado
Strongly-typed MongoDB driver for Rust
Stars: ✭ 70 (-48.91%)
Mutual labels:  json-schema, json
Quicktype
Generate types and converters from JSON, Schema, and GraphQL
Stars: ✭ 7,459 (+5344.53%)
Mutual labels:  json-schema, json
Npoint
JSON storage bins with schema validation
Stars: ✭ 116 (-15.33%)
Mutual labels:  json-schema, json
Conf
Simple config handling for your app or module
Stars: ✭ 707 (+416.06%)
Mutual labels:  json-schema, json
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+28796.35%)
Mutual labels:  json-schema, json
Jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Stars: ✭ 5,633 (+4011.68%)
Mutual labels:  json-schema, json
Oakdex Pokedex
Ruby Gem and Node Package for comprehensive Generation 1-7 Pokedex data, including 809 Pokémon, uses JSON schemas to verify the data
Stars: ✭ 44 (-67.88%)
Mutual labels:  json-schema, json
Jsonforms
Customizable JSON Schema-based forms with React, Angular and Vue support out of the box.
Stars: ✭ 542 (+295.62%)
Mutual labels:  json-schema, json
Json Forms
JSON Schema to HTML form generator, supporting dynamic subschemas (on the fly resolution). Extensible and customizable library with zero dependencies. Bootstrap add-ons provided
Stars: ✭ 549 (+300.73%)
Mutual labels:  json-schema, json
Schemasafe
A reasonably safe JSON Schema validator with draft-04/06/07/2019-09 support.
Stars: ✭ 67 (-51.09%)
Mutual labels:  json-schema, json
Schema Registry
Confluent Schema Registry for Kafka
Stars: ✭ 1,647 (+1102.19%)
Mutual labels:  json-schema, json

.. image:: https://travis-ci.org/saschpe/libvirt-hook-qemu.svg?branch=master :target: https://travis-ci.org/saschpe/libvirt-hook-qemu

Libvirt port-forwarding hook

Libvirt hook for setting up iptables port-forwarding rules when using NAT-ed networking.

Installation

To install the hook script and it's configuration files, simply use the Makefile_:

.. code-block:: bash

$ sudo make install

Afterwards customize /etc/libvirt/hooks/qemu.json to your needs. This Makefile target can be invoked multiple times, already installed configuration files won't be touched. The files can be removed again with:

.. code-block:: bash

$ sudo make uninstall

Testing

To run unit tests use the test target of the Makefile_:

.. code-block:: bash

$ make test

Or use the Python unittest module to discover tests directly:

.. code-block:: python

python -m unittest discover

Networking

This section describes the theory behind the generated iptables statements.

Packets arriving on the public interface are DNATed to the virtual machine. This implements the actual port-forwarding. Due to the way iptables is implemented, the DNAT must occur in two chains: nat:PREROUTING for packets arriving on the public interface, and nat:OUTPUT for packets originating on the host.

We also add rules to the FORWARD chain to ensure the responses return.

Finally, packets originating on the guest and sent to the host's public IP address need special handling. They are DNATed back to the guest like all other packets but, because the destination is now the same as the source, the reply never leaves the guest. Therefore, the host SNATs these packets to ensure the reply returns over the bridge.

To see a real-world example, the test_setup function in test_qemu.py_ demonstrates a simple JSON configuration and the iptables rules that it produces.

Authors

  • Sascha Peilicke
  • Scott Bronson

.. _Makefile: Makefile .. _test_qemu.py: test_qemu.py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].