All Projects → Jamesits → Systemd Named Netns

Jamesits / Systemd Named Netns

Licence: gpl-3.0
Use named netns (net namespace) with systemd services!

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Systemd Named Netns

Ecominit
eComInit is a free init system and service manager designed to scale from lightweight desktops to web-scale cloud deployments. It aims to offer feature-parity with systemd but with a modular, portable architecture compliant with software engineering best-practice.
Stars: ✭ 352 (+458.73%)
Mutual labels:  systemd
Log4j Systemd Journal Appender
Log4j appender for systemd-journal that maintains structured log data
Stars: ✭ 23 (-63.49%)
Mutual labels:  systemd
Systemd
The systemd System and Service Manager
Stars: ✭ 8,841 (+13933.33%)
Mutual labels:  systemd
Kubernetes Ansible
🎄ansible多网卡机器上一键部署高可用Kubernetes(systemd)
Stars: ✭ 402 (+538.1%)
Mutual labels:  systemd
Hardening
Hardening Ubuntu. Systemd edition.
Stars: ✭ 705 (+1019.05%)
Mutual labels:  systemd
Ansible Debian Bootstrap
Ansible bootstrap role for Debian/Devuan/Ubuntu/Kali Linux/Raspbian servers
Stars: ✭ 37 (-41.27%)
Mutual labels:  systemd
Restic Systemd Automatic Backup
My restic backup solution using Backblaze B2 storage, systemd timers (or cron) and email notifications on failure.
Stars: ✭ 314 (+398.41%)
Mutual labels:  systemd
Mkinitcpio Systemd Tool
Provisioning tool for systemd in initramfs (systemd-tool)
Stars: ✭ 60 (-4.76%)
Mutual labels:  systemd
Python Systemd Tutorial
A tutorial for writing a systemd service in Python
Stars: ✭ 746 (+1084.13%)
Mutual labels:  systemd
Resticprofile
Configuration profiles for restic backup
Stars: ✭ 48 (-23.81%)
Mutual labels:  systemd
Rustysd
A service manager that is able to run "traditional" systemd services, written in rust
Stars: ✭ 416 (+560.32%)
Mutual labels:  systemd
Systemd Manager
A systemd service manager written in Rust with the GTK-rs wrapper and direct integration with dbus
Stars: ✭ 552 (+776.19%)
Mutual labels:  systemd
Zram Init
A wrapper script for the zram linux kernel module with zsh and openrc support
Stars: ✭ 41 (-34.92%)
Mutual labels:  systemd
Clight
A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
Stars: ✭ 371 (+488.89%)
Mutual labels:  systemd
Systemctl Php
PHP wrapper for systemctl
Stars: ✭ 54 (-14.29%)
Mutual labels:  systemd
Dmenu Extended
An extension to dmenu for quickly opening files and folders.
Stars: ✭ 334 (+430.16%)
Mutual labels:  systemd
Systemdclash
Clash 以 systemd 服务的方式开机自启
Stars: ✭ 31 (-50.79%)
Mutual labels:  systemd
Sway De
🏠 Sway desktop environment dotfile installation for Arch Linux
Stars: ✭ 63 (+0%)
Mutual labels:  systemd
Vim Systemd Syntax
Syntax highlighting for systemd service files in Vim.
Stars: ✭ 57 (-9.52%)
Mutual labels:  systemd
Rdm
A toy display manager written in Rust. Inspired by Slim it aims to provide a simple and elegant login screen.
Stars: ✭ 42 (-33.33%)
Mutual labels:  systemd

systemd-named-netns

This project enables you to:

  • Create and delete named netns on the fly like systemd services
  • Start named netns on boot
  • Quickly set up bridging or NAT from netns to host
  • Use named netns in systemd services
    • Enables them to connect to the internet too
    • And you can manually switch to its netns (since they are named)

Installation

Dependencies:

  • Recent version of systemd (newer is better; tested down to v232)
  • iproute2
  • iptables (only if you use default NAT config)
  • /usr/bin/env

For installation, run make install with root privilege.

You ran run make uninstall to remove the systemd units, but the configs located in /etc/default will not be removed.

Quickstart

systemctl start [email protected]
chnetns helloworld ip address

Note: Network interface names are derived from the netns name, so do not create netns names longer than 12 characters.

NS Types

Basic ([email protected])

It creates a new netns. Use this if you want to customize everything by hand. All other types depend on this.

NAT ([email protected])

It creates a new netns with NATed network access (like VMNet8). Use this if you want to get things quickly up and running without any network hassles.

Note:

  • The default configuration will only work for the first netns-nat instance. You need to change the IP addresses if you want 2 or more netns-nat instances running at the same time.
  • This will setup packet forwarding on your Linux kernel, making your host a router (this might cause security problems if set incorrectly)
  • If you want automatic iptables accept rules, set NAT_ACCEPT_TRAFFIC=1

Tunnel ([email protected])

It creates a new netns with a pseudo wire to the host (like VMNet1). Use this if you want to communicate with the program inside the netns but don't want them to have internet access, or if you want to assign routable IPs to a netns.

Bridge ([email protected])

It bridges the new netns to a Linux bridge. You need to set up the bridge first: see wiki if you are not sure what to do.

MACVLAN Bridge ([email protected])

Alternative to NSType bridge. A MACVLAN Bridge allows you to create multiple interfaces with different Layer 2 (that is, Ethernet MAC) addresses on top of a single NIC. MACVLAN is a bridge without an explicit bridge device.

For netns-mvbr, ${MACVLAN_BRIDGE} will be the bridge device (usually your physical NIC device).

Note that any MACVLAN devices in other netns's will be able to communicate each other and the outside world but NOT the bridge device. If you want to enable communication with the root netns, you can add a MACVLAN device in the root netns and use that instead of the MACVLAN bridge device.

Resources

References

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].