- Thread Starter
- #51
on Linux :
Code:
# iptables -t nat -A POSTROUTING -o mlan0 -j MASQUERADE
# ip tuntap add tap0 mode tap
# ip link set dev tap0 up
# ifconfig tap0 192.168.99.1/24
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -L -v -t nat
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
13 1203 MASQUERADE all -- any mlan0 anywhere anywhere
# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.99.1 icmp_seq=1 Destination Host Unreachable
From 192.168.99.1 icmp_seq=2 Destination Host Unreachable
From 192.168.99.1 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4144ms
pipe 4
# ping google.com
ping: google.com: Nome o servizio sconosciuto