_ __
\ \/ /___ __ __ ___ ___ ___ Useful Commands:
\ // _ \\ \/ /,-_ |/ _ |/ -_) remountrw - mount disk as read-write
\/ \___/ \ / \___,\_ |\___| remountro - mount disk as read-only
_/_/ _'_| remove.docs - remove all docs and manpages
{ V o y a g e } - L i n u x
< http://linux.voyage.hk > Version: 0.9 (Build Date 20120927)
root@voyage:/etc# vi wvdial.conf
[Dialer Defaults]
Init1 = ATZ
#Init2 = AT V1 E1 S0=0 &C1 &D2 +FCLASS=0
#Init2 = AT&F E1 V1 X1 &D2 &C1 S0=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
#Modem = /dev/ttyUSB2
ISDN = 0
[Dialer vodafone]
Phone = *99#
Stupid Mode = 1
Init2=ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3=AT+COPS=3,2
Init4=AT+CGDCONT=1,"IP","internet"
Username = ;
Password = ;
; Phone =
; Password =
; Username =
root@voyage:/etc# vi /etc/ppp/peers/wvdial
noauth
passive
kdebug 4
noccp
#persist
name wvdial
noipdefault
usepeerdns
defaultroute
replacedefaultroute
proxy.sh
#!/bin/sh
echo "Setting up IPTABLES proxy..."
#
# enabling IP forwarding...
#
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
#
# Flushing packet filtering rules
#
iptables -t filter -F INPUT
iptables -t filter -F OUTPUT
iptables -t filter -F FORWARD
iptables -t nat -F
#
# Setting up default policies
#
iptables -t filter -P INPUT ACCEPT
iptables -t filter -P OUTPUT ACCEPT
iptables -t filter -P FORWARD DROP
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
#
# Setting up NAT
#
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -t filter -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -i eth0 -o ppp0 -j ACCEPT
echo "proxy setup done."
\ \/ /___ __ __ ___ ___ ___ Useful Commands:
\ // _ \\ \/ /,-_ |/ _ |/ -_) remountrw - mount disk as read-write
\/ \___/ \ / \___,\_ |\___| remountro - mount disk as read-only
_/_/ _'_| remove.docs - remove all docs and manpages
{ V o y a g e } - L i n u x
< http://linux.voyage.hk > Version: 0.9 (Build Date 20120927)
root@voyage:/etc# vi wvdial.conf
[Dialer Defaults]
Init1 = ATZ
#Init2 = AT V1 E1 S0=0 &C1 &D2 +FCLASS=0
#Init2 = AT&F E1 V1 X1 &D2 &C1 S0=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
#Modem = /dev/ttyUSB2
ISDN = 0
[Dialer vodafone]
Phone = *99#
Stupid Mode = 1
Init2=ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3=AT+COPS=3,2
Init4=AT+CGDCONT=1,"IP","internet"
Username = ;
Password = ;
; Phone =
; Password =
; Username =
root@voyage:/etc# vi /etc/ppp/peers/wvdial
noauth
passive
kdebug 4
noccp
#persist
name wvdial
noipdefault
usepeerdns
defaultroute
replacedefaultroute
proxy.sh
#!/bin/sh
echo "Setting up IPTABLES proxy..."
#
# enabling IP forwarding...
#
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
#
# Flushing packet filtering rules
#
iptables -t filter -F INPUT
iptables -t filter -F OUTPUT
iptables -t filter -F FORWARD
iptables -t nat -F
#
# Setting up default policies
#
iptables -t filter -P INPUT ACCEPT
iptables -t filter -P OUTPUT ACCEPT
iptables -t filter -P FORWARD DROP
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
#
# Setting up NAT
#
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -t filter -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -i eth0 -o ppp0 -j ACCEPT
echo "proxy setup done."
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου