Created
February 1, 2022 11:38
-
-
Save tomty89/9a0c181af1e67a2da6e47952f34e5a67 to your computer and use it in GitHub Desktop.
temp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=dnsmasq - A lightweight DHCP and caching DNS server | |
Documentation=man:dnsmasq(8) | |
BindsTo=netns-temp.service | |
After=network.target netns-temp.service | |
Before=network-online.target nss-lookup.target | |
Wants=nss-lookup.target | |
[Service] | |
NetworkNamespacePath=/run/netns/temp | |
ExecStartPre=/usr/bin/dnsmasq --test | |
ExecStart=/usr/bin/dnsmasq -k --user=dnsmasq --pid-file -C /etc/dnsmasq/temp.conf | |
ExecReload=/bin/kill -HUP $MAINPID | |
Restart=on-failure | |
PrivateDevices=true | |
ProtectSystem=full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=netns for temp | |
Requisite=systemd-networkd.service | |
After=systemd-networkd.service | |
[email protected] | |
[email protected] | |
Wants=dnsmasq-temp.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStartPre=/usr/bin/ip netns add temp | |
ExecStart=/usr/bin/ip link set temp netns temp | |
ExecStartPost=/usr/bin/ip -n temp link set lo up | |
ExecStartPost=/usr/bin/ip -n temp link set temp up | |
ExecStartPost=/usr/bin/ip -n temp addr add 192.168.150.253/24 dev temp | |
ExecStartPost=/usr/bin/ip -n temp route add default via 192.168.150.1 | |
ExecStop=/usr/bin/ip -n temp link set temp netns 1 | |
ExecStopPost=/usr/bin/ip netns delete temp | |
[Install] | |
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DNSStubListenerExtra=192.168.150.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listen-address=127.0.0.53 | |
bind-interfaces | |
no-resolv | |
no-hosts | |
cache-size=0 | |
server=192.168.150.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
systemd/systemd@a8d0906 might be an alternative to the extra stub listener