root@lwf2:/home/junior# ip a ; ip r ; ip -s l ; sudo iptables-save -c ; sysctl n
et.ipv4.ip_forward
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP ql
en 1000
link/ether 00:25:22:75:e8:38 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.88/24 brd 192.168.0.255 scope global eth0
inet6 fe80::225:22ff:fe75:e838/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNO
WN qlen 1000
link/ether 00:30:4f:2b:58:67 brd ff:ff:ff:ff:ff:ff
inet6 fe80::230:4fff:fe2b:5867/64 scope link
valid_lft forever preferred_lft forever
4: gre0: <NOARP> mtu 1476 qdisc noop state DOWN
link/gre 0.0.0.0 brd 0.0.0.0
5: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast sta
te UNKNOWN qlen 3
link/ppp
inet 193.200.32.191 peer 193.200.32.2/32 scope global ppp0
default dev ppp0 scope link
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.88
193.200.32.2 dev ppp0 proto kernel scope link src 193.200.32.191
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
1333911 8119 0 0 0 0
TX: bytes packets errors dropped carrier collsns
1333911 8119 0 0 0 0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP ql
en 1000
link/ether 00:25:22:75:e8:38 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
67292393 426329 0 0 0 3
TX: bytes packets errors dropped carrier collsns
1564208274 1189319 0 0 0 0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNO
WN qlen 1000
link/ether 00:30:4f:2b:58:67 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
1589287217 1314529 0 145 0 0
TX: bytes packets errors dropped carrier collsns
98509993 805635 0 0 0 0
4: gre0: <NOARP> mtu 1476 qdisc noop state DOWN
link/gre 0.0.0.0 brd 0.0.0.0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
5: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast sta
te UNKNOWN qlen 3
link/ppp
RX: bytes packets errors dropped overrun mcast
1533488831 1179264 0 0 0 0
TX: bytes packets errors dropped carrier collsns
80519872 798858 0 0 0 0
sudo: unable to resolve host lwf2
# Generated by iptables-save v1.4.12 on Sun Jul 28 13:23:57 2013
*mangle
:PREROUTING ACCEPT [417:82428]
:INPUT ACCEPT [116:23804]
:FORWARD ACCEPT [299:58375]
:OUTPUT ACCEPT [85:13174]
:POSTROUTING ACCEPT [384:71549]
[16:840] -A FORWARD -o ppp+ -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --ms
s 1300:1500 -j TCPMSS --clamp-mss-to-pmtu
[1:60] -A OUTPUT -o ppp+ -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1
300:1500 -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Sun Jul 28 13:23:57 2013
# Generated by iptables-save v1.4.12 on Sun Jul 28 13:23:57 2013
*nat
:PREROUTING ACCEPT [86:7531]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [8:740]
:POSTROUTING ACCEPT [8:740]
[5:256] -A PREROUTING -s 192.168.0.0/24 ! -d 192.168.0.0/24 -i eth+ -p tcp -m tc
p --dport 80 -j REDIRECT --to-ports 3128
[0:0] -A PREROUTING -i ppp+ -p udp -m udp --dport 1723 -j DNAT --to-destination
192.168.0.6
[0:0] -A PREROUTING -i ppp+ -p tcp -m tcp --dport 8008 -j DNAT --to-destination
192.168.0.100
[28:2780] -A POSTROUTING -s 192.168.0.0/24 ! -d 192.168.0.0/24 -o ppp+ -j MASQUE
RADE
COMMIT
# Completed on Sun Jul 28 13:23:57 2013
# Generated by iptables-save v1.4.12 on Sun Jul 28 13:23:57 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [95:15038]
[30:5698] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A INPUT -p icmp -j ACCEPT
[2:100] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 22 -j ACCEPT
[84:18006] -A INPUT -j REJECT --reject-with icmp-host-prohibited
[0:0] -A INPUT -s 192.168.0.0/24 -i eth+ -p tcp -m conntrack --ctstate NEW -m tc
p --dport 3128 -j ACCEPT
[0:0] -A INPUT -s 192.168.0.0/24 -i eth+ -j ACCEPT
[257:54573] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A FORWARD -p icmp -j ACCEPT
[42:3802] -A FORWARD -s 192.168.0.0/24 ! -d 192.168.0.0/24 -i eth+ -o ppp+ -j AC
CEPT
[0:0] -A FORWARD -d 192.168.0.6/32 -i ppp+ -o eth+ -p udp -m udp --dport 1723 -j
ACCEPT
[0:0] -A FORWARD -d 192.168.0.100/32 -i ppp+ -o eth+ -p tcp -m tcp --dport 8008
-j ACCEPT
[0:0] -A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Sun Jul 28 13:23:57 2013
net.ipv4.ip_forward = 1
root@lwf2:/home/junior# nslookup ya.ru ; nslookup ya.ru 8.8.8.8 ; ping -c4 ya.ru
; tracepath ya.ru ; ss -lnpt | grep :3128
Server: 192.168.0.88
Address: 192.168.0.88#53
Non-authoritative answer:
Name: ya.ru
Address: 87.250.251.3
Name: ya.ru
Address: 93.158.134.3
Name: ya.ru
Address: 93.158.134.203
Name: ya.ru
Address: 213.180.193.3
Name: ya.ru
Address: 213.180.204.3
Name: ya.ru
Address: 77.88.21.3
Name: ya.ru
Address: 87.250.250.3
Name: ya.ru
Address: 87.250.250.203
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: ya.ru
Address: 87.250.250.3
Name: ya.ru
Address: 87.250.250.203
Name: ya.ru
Address: 87.250.251.3
Name: ya.ru
Address: 93.158.134.3
Name: ya.ru
Address: 93.158.134.203
Name: ya.ru
Address: 213.180.193.3
Name: ya.ru
Address: 213.180.204.3
Name: ya.ru
Address: 77.88.21.3
PING ya.ru (87.250.250.203) 56(84) bytes of data.
64 bytes from
www.yandex.ru (87.250.250.203): icmp_req=1 ttl=55 time=26.1 ms
64 bytes from
www.yandex.ru (87.250.250.203): icmp_req=2 ttl=56 time=26.2 ms
64 bytes from
www.yandex.ru (87.250.250.203): icmp_req=3 ttl=55 time=26.2 ms
64 bytes from
www.yandex.ru (87.250.250.203): icmp_req=4 ttl=56 time=26.1 ms
--- ya.ru ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 26.104/26.170/26.222/0.123 ms
1: 193.200.32.191 0.238ms pmtu 1492
1: 193.200.32.2 0.541ms
1: 193.200.32.2 0.639ms
2: 193.200.32.113 168.143ms
3: telemost-ua.ua-kiev.datagroup.ua 0.845ms asymm 4
4: ae21-771.s31.kiev.datagroup.ua 7.736ms asymm 5
5: 176.241.104.182 8.029ms
6: 87.250.239.71 22.532ms asymm 5
7: no reply
8: s3600-965.yandex.net 27.258ms asymm 11
9: s3600-965.yandex.net 26.878ms asymm 11
10:
www.yandex.ru 26.462ms reached
Resume: pmtu 1492 hops 10 back 56
LISTEN 0 128 *:3128 *:*
users:(("squid3",1036,15))