Internet & Linux Daantje on 19 Jan 2003 02:28 pm
Masquerading your MXstream to VMware?
Okay, I have an inernal network, and MXstream over a pptp connection. (But this should work with any ppp/eth0 connections.) Here is a way to masqurade it to your eth0 device. (I personaly use it to have internet on my VMware workstation ;)) Before you begin, you should have the following stuff compiled into your kernel: (cd /usr/src/linux;make menuconfig;)
- Under Networking Options
- Network packet filtering (CONFIG_NETFILTER)
- Under Networking Options->Netfilter Configuration
- Connection tracking (CONFIG_IP_NF_CONNTRACK)
- FTP Protocol support (CONFIG_IP_NF_FTP)
- IP tables support (CONFIG_IP_NF_IPTABLES)
- Connection state match support (CONFIG_IP_NF_MATCH_STATE)
- Packet filtering (CONFIG_IP_NF_FILTER)
- REJECT target support (CONFIG_IP_NF_TARGET_REJECT)
- Full NAT (CONFIG_IP_NF_NAT)
- MASQUERADE target support (CONFIG_IP_NF_TARGET_MASQUERADE)
- REDIRECT target support (CONFIG_IP_NF_TARGET_REDIRECT)
- Packet mangling (CONFIG_IP_NF_MANGLE)
- LOG target support (CONFIG_IP_NF_TARGET_LOG)
Then I runned the following script to config the masquerading: (the script should be ‘chmod +x’ and be run as root.)
#!/bin/sh #### START MASQUERADE ############## # Init kernel module. Can be remarked, when compiled into the kernel # modprobe ipt_MASQUERADE; # If this fails, try continuing anyway iptables -F; iptables -t nat -F; iptables -t mangle -F; iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE; echo 1 > /proc/sys/net/ipv4/ip_forward; #### START SECURITY ############## #for a dial-up connection (with eth0 as the internal network card): iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT; iptables -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT; iptables -P INPUT DROP; #only if the first two are succesful iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT;
Now you should config all client gateways to the IP address from your eth0 device. Im my case, I had to set the gateway of my VMware Win98 network to the address of my eth0; 10.0.0.242. The IP address of the Win98 is set to 10.0.0.243, and subnetmask 255.255.255.0. The DNS is set to my accesss provider XS4ALL, 194.109.104.104. I’m using ADSL4linux (www.adsl4linux.nl) to connect to MXstream.
For more information about masquerading: http://www.ibiblio.org/pub/Linux/docs/HOWTO/Masquerading-Simple-HOWTO
Only posted it here, in the hope it helps someone… ;)
Leave a Reply
You must be logged in to post a comment.