Advertisement
Guest User

Untitled

a guest
Jun 14th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. mkdir -p /opt/cni
  4. ln -s /mnt/data/podman/cni/ /opt/cni/bin
  5. ln -s /mnt/data/podman/cni/20-dns.conflist /etc/cni/net.d/20-dns.conflist
  6.  
  7. # Create a new bridge interface so the host can talk to containers inside the podman macvlan network
  8. # Assumes your Podman network made in the controller is on VLAN 5
  9. # Adjust the IP to match the address in your cni configuration
  10. ip link add br5.mac link br5 type macvlan mode bridge
  11. ip addr add 192.168.5.2/24 dev br5.mac
  12. ip link set br5.mac up
  13. ip route add 192.168.5.5/32 dev br5.mac proto static scope link
  14. podman start pihole
  15.  
  16. #Adjust these rules to your setup and interfaces
  17. #iptables -t nat -C PREROUTING -i br0 -p udp ! --source 192.168.5.5 ! --destination 192.168.5.5 --dport 53 -j DNAT --to 192.168.5.5 || iptables -t nat -A PREROUTING -i br0 -p u
  18. #iptables -t nat -C PREROUTING -i br0 -p tcp ! --source 192.168.5.5 ! --destination 192.168.5.5 --dport 53 -j DNAT --to 192.168.5.5 || iptables -t nat -A PREROUTING -i br0 -p t
  19. #iptables -t nat -C POSTROUTING -o br0 -d 192.168.5.5 -p tcp --dport 53 -j MASQUERADE || iptables -t nat -A POSTROUTING -o br0 -d 192.168.5.5 -p tcp --dport 53 -j MASQUERADE
  20. #iptables -t nat -C POSTROUTING -o br0 -d 192.168.5.5 -p udp --dport 53 -j MASQUERADE || iptables -t nat -A POSTROUTING -o br0 -d 192.168.5.5 -p udp --dport 53 -j MASQUERADE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement