diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-11-15 18:10:42 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2019-11-15 18:10:42 +0100 |
commit | 0873566ff05c02be063f3aa15adecb725342119c (patch) | |
tree | a6dcddf0f0c08c9ff9cdd89e1f95196af2ff5a6a /docs/src/content/howto-transparent-vms.md | |
parent | d852f292c9a45de7f45cc8537f2aef217259017e (diff) | |
parent | fbbbbb678e77e3cff5ab35b1fd55e85e875ed3f5 (diff) | |
download | mitmproxy-0873566ff05c02be063f3aa15adecb725342119c.tar.gz mitmproxy-0873566ff05c02be063f3aa15adecb725342119c.tar.bz2 mitmproxy-0873566ff05c02be063f3aa15adecb725342119c.zip |
Merge remote-tracking branch 'origin/master' into pr-3448
Diffstat (limited to 'docs/src/content/howto-transparent-vms.md')
-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 >}} |