Quote:
Ok, this looks promising, but I haven't fully tested it, so here goes:
First, start up the YaST software installer, search for dhcp-server, install. (this just makes things easier, not strictly necessary but allows for further expansion too). If you no longer have the install discs, you can add an online repository source like so:
YaST->Software->Installation Source->Add...->HTTP->download.opensuse.org in the name ->
/distribution/SL-10.1/inst-source/ in the directory ->Accept->wait while it adds it.
Once dhcp-server (dhcpd) is installed, download the firestarter firewall RPM from
here . Open a terminal, become root (su then the root password), navigate to where you saved the rpm, type "rpm -Uvh firestarter[tab][enter]", the tab will complete the rest of the filename (this is a nice feature called tab completion, try it out if you don't already know about it). It should install without issue and put an icon in the SuSE main menu, start it up and set 'er up.
For setup info, go to the
Firestarter documentation. hope this works well for you.
Or you could do this:
[code:1:2914067add]
#!/bin/sh
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -d 1.2.3.4 -i eth1 -j DNAT --to-destination 192.168.0.2
iptables -t nat -A POSTROUTING -s 192.168.0.1 -o eth1 -j SNAT --to-source 1.2.3.4
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT -o eth1 --to-source 1.2.3.4
iptables -A FORWARD -p tcp -i eth0 -o eth1 -d 192.168.0.1 -m multiport --dport 80,443,53,22 -m state --state NEW -j ACCEPT
iptables -A FORWARD -t filter -o eth0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -t filter -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -t filter -o eth1 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -t filter -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
[/code:1:2914067add]
Save this to /etc/init.d/routing
chmod a+rx /etc/init.d/routing
/etc/init.d/routing
Where 1.2.3.4 is your public IP address and 192.168.0.0/24 is your private subnet
:-D