diff options
author | Nirusu <Nirusu@users.noreply.github.com> | 2019-09-30 11:41:49 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2019-09-30 11:41:49 +0200 |
commit | 7ef91f46a32808bf6226a993e06d0a6522a663d5 (patch) | |
tree | 861bc1c7e378af272118a1aeff39ff05e09db4c3 /docs | |
parent | 965dd3cfb5f07e8d8a77699404fc6081b330a938 (diff) | |
download | mitmproxy-7ef91f46a32808bf6226a993e06d0a6522a663d5.tar.gz mitmproxy-7ef91f46a32808bf6226a993e06d0a6522a663d5.tar.bz2 mitmproxy-7ef91f46a32808bf6226a993e06d0a6522a663d5.zip |
Update howto-transparent-vms.md for newer versions (#3597)
Update howto-transparent-vms.md for newer versions
Diffstat (limited to 'docs')
-rw-r--r-- | docs/src/content/howto-transparent-vms.md | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/docs/src/content/howto-transparent-vms.md b/docs/src/content/howto-transparent-vms.md index 1446ede7..f251bc44 100644 --- a/docs/src/content/howto-transparent-vms.md +++ b/docs/src/content/howto-transparent-vms.md @@ -14,9 +14,13 @@ Internal Network* setup can be applied to other setups. ## 1. Configure Proxy VM -On the proxy machine, **eth0** is connected to the internet. **eth1** is -connected to the internal network that will be proxified and configured -to use a static ip (192.168.3.1). +First, we have to find out under which name Ubuntu has mapped our network interfaces. You can find this information with: + +{{< highlight bash >}} +ip link +{{< / highlight >}} + +Usually with Ubuntu and Virtualbox, **eth0** or **enp0s3** (Ubuntu 15.10 and newer) is connected to the internet and **eth1** or **enp0s8** (Ubuntu 15.10 and newer) is connected to the internal network that will be proxified and configured to use a static ip (192.168.3.1). If the names differ, use the ones you got from the *ip link* command. ### VirtualBox configuration @@ -65,6 +69,7 @@ Replace **/etc/dnsmasq.conf** with the following configuration: {{< highlight none >}} # Listen for DNS requests on the internal network interface=eth1 +bind-interfaces # Act as a DHCP server, assign IP addresses to clients dhcp-range=192.168.3.10,192.168.3.100,96h # Broadcast gateway and dns server information @@ -93,10 +98,11 @@ IP address via DHCP: ## 3. Redirect traffic to mitmproxy -To redirect traffic to mitmproxy, we need to add two iptables +To redirect traffic to mitmproxy, we need to enable IP forwarding and add two iptables rules: {{< highlight bash >}} +sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080 sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 8080 {{< / highlight >}} |