Netzwerkkonfig unter Debian/Kali über Interfaces: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „=Konfigdatei= */etc/network/interfaces <pre> source /etc/network/interfaces.d/* auto lo iface lo inet loopback iface eth0 inet static address 172.10.20.1 n…“) |
|||
| (12 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| + | =Temporäres änderen der IP= | ||
| + | *ip address add 172.10.1.179/26 dev eth0 | ||
| + | |||
=Konfigdatei= | =Konfigdatei= | ||
*/etc/network/interfaces | */etc/network/interfaces | ||
| Zeile 7: | Zeile 10: | ||
iface lo inet loopback | iface lo inet loopback | ||
| + | auto eth0 | ||
iface eth0 inet static | iface eth0 inet static | ||
address 172.10.20.1 | address 172.10.20.1 | ||
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 | ||
| + | pre-down 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 | iface eth1 inet static | ||
| − | address 192.168. | + | address 192.168.66.51 |
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
</pre> | </pre> | ||
| + | |||
| + | =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 | ||
Aktuelle Version vom 13. Oktober 2020, 08:14 Uhr
Temporäres änderen der IP
- ip address add 172.10.1.179/26 dev eth0
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-down 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