linux route dhcp upc
Kategorie: linux

############################
# firewall
#!/bin/sh

pon cdma
debian:~# cat /etc/
debian:~# cat firewall
#!/bin/sh

IPTABLES="/sbin/iptables"

echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr

$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT
$IPTABLES -t mangle -P PREROUTING ACCEPT
$IPTABLES -t mangle -P OUTPUT ACCEPT
$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F
$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X

$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT

$IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

## ## ## ## ## ## ## ##

iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth4 -j SNAT --to-source 84.42.244.87

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth4 -j SNAT --to-source (ipcko toho UPC dhcp)

####################################
# interfaces

# The loopback network interface
auto lo
iface lo inet loopback

####################################
debian:~# cat /etc/network/options
ip_forward=yes
spoofprotect=yes
syncookies=no


auto eth2
iface eth2 inet static
address 192.168.0.1
netmask 255.255.255.0


auto eth4
iface eth4 inet dhcp
hw ether 0002A5588A79





16.2.2007 19:59:41