[HackSoc] mini-HOWTO: gateway from eth0 out through wlan0

Tim Chambers tim.chambers at hp.com
Wed Jan 21 22:28:28 MST 2004


Last night this topic came up. ISTR that the following script contains
enough to do it. I call it xover. It's merely an adaptation of a script
jafo gave me. YMMV.

<>< Tim

#!/bin/sh

# this sets up this machine as a gateway (e.g. tummy wireless) for
# that machine connected via crossover cable
#
# set that machine up with static IP 192.168.0.1, netmask
# 255.255.255.0, gateway 192.168.0.254, name server same as this
# machine (10.1.6.254 at tummy)
# /sbin/ifconfig eth0 192.168.0.254 netmask 255.255.255.0 broadcast
192.168.0.255
# in Windows, configure with static IP, same netmask, this machine's DNS
# for my ze4145, per
http://www.knoppix.net/forum/viewtopic.php?t=2117&start=15
# try rmii-tool -r to restart autonegotiation, then netcardconfig and
# answer the questions

# thanks, jafo (tbc, 10/21/03)
set -x
/sbin/ifconfig eth0 192.168.0.254 netmask 255.255.255.0 broadcast
192.168.0.255
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -F FORWARD
/sbin/iptables -F POSTROUTING -t nat
/sbin/iptables -F PREROUTING -t nat
/sbin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
#/sbin/iptables -L FORWARD
echo 1 >/proc/sys/net/ipv4/ip_forward

# dhcpd -cf /home/jafo/etc/dhcpd-10.1.4.0-server




More information about the HackingSociety mailing list