gjhicks
Group: Members
Posts: 108
Joined: April 2004 |
|
Posted: Mar. 02 2006,21:56 |
|
Hi,
One of the NICs is connected by wire and by IP address to the ADSL Modem/Router, the other NIC is connected by wire and IP address to the wireless access point, that serves the local LAN.
In addition, I have a content filtering proxy, called Privoxy, and a "scratch" file sharing area on the DSL box, that all local LAN users can access. Lastly, I have Xvnc installed (the mydsl package) which is started at boot from /home/dsl/.xinitrc.
I have a HD installed DSL v2.0. I use the following script, executed at startup (called from /opt/bootlocal.sh):
#!/bin/sh # clear echo Here will be stuff that I want executed at boot! echo ------------------------------------------------ sleep 2 echo shut down eth0 and eth1 echo ------------------------------------------------ ifconfig eth1 down ifconfig eth0 down sleep 2
# eth1 is the nic connected to the router, so use DHCP # pump -i eth1 sleep 2
echo set the static IP address for eth0, connected to local LAN echo --------------------------------------------------------
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 sleep 2
echo setup the iptables rules echo ------------------------------------------------ # content filtering proxy, Privoxy, takes http from port 80 and # sends filtered content to port 8118, so use iptables to catch # unfiltered port 80
iptables --flush iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE iptables --append FORWARD --in-interface eth0 -j ACCEPT iptables -I FORWARD -p TCP -i eth0 --dport 80 -j REJECT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo set up privoxy echo ------------------------------------------------
/home/dsl/gjh-privoxy.sh sleep 2
echo set up samba, to allow local LAn users access to the DSL box echo ------------------------------------------------------------ mount /dev/hda1
sudo nmbd -D -s /opt/samba/smb.conf sudo smbd -D -s /opt/samba/smb.conf
#--------------------------------------------------------
Hope that this helps.
Regards,
Geoff
|