Netzwerkkonfig unter Debian/Kali über Interfaces: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 12: Zeile 12:
 
  netmask 255.255.0.0
 
  netmask 255.255.0.0
 
  gateway 172.10.1.1
 
  gateway 172.10.1.1
  #
+
  # Nat wenn Schnittstelle hochgefahren wird
 
  post-up  iptables -t nat -A POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1
 
  post-up  iptables -t nat -A POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1
 
  pre-up  iptables -t nat -D POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1
 
  pre-up  iptables -t nat -D POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1

Version vom 13. Oktober 2020, 08:03 Uhr

Konfigdatei

  • /etc/network/interfaces
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
 address 172.10.20.1
 netmask 255.255.0.0
 gateway 172.10.1.1
 # Nat wenn Schnittstelle hochgefahren wird
 post-up  iptables -t nat -A POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1
 pre-up   iptables -t nat -D POSTROUTING -s 192.168.66.0/24 -j SNAT -o eth0 --to-source 172.10.20.1


auto eth1
iface eth1 inet static
 address 192.168.66.51
 netmask 255.255.255.0

Hoch und Runterfahren der Schnittstellen

  • ifup -va
  • ifdown -va

Nameserver

  • /etc/resolv.conf

search U26

nameserver 172.10.1.1

Forwarding

  • /etc/systctl.conf
net.ipv4.ip_forward = 1
  • sysctl -p