: 06 lutego 2014, 19:29
A pingi do eth1 i na bramę przechodzą?
Polski portal użytkowników dystrybucji Debian GNU/Linux, dyskusje, artykuły, nowości, blog, porady, pomoc.
https://www.debian.pl/
Kod: Zaznacz cały
# iptables -L
Kod: Zaznacz cały
# ifconfig
Kod: Zaznacz cały
$ cat /etc/resolv.conf
ifconfig:>> iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:81
ACCEPT tcp -- anywhere anywhere tcp spt:ftp
ACCEPT tcp -- anywhere anywhere tcp spt:http
ACCEPT tcp -- anywhere anywhere tcp spt:81
ACCEPT tcp -- anywhere anywhere tcp spt:http-alt
ACCEPT tcp -- anywhere anywhere tcp spt:ssh
ACCEPT udp -- anywhere anywhere udp spt:domain
ACCEPT tcp -- anywhere anywhere tcp spt:8074
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ssh
ACCEPT udp -- anywhere 192.168.2.2 udp dpt:ssh
ACCEPT tcp -- anywhere 192.168.1.2 tcp dpt:ssh
ACCEPT udp -- anywhere 192.168.1.2 udp dpt:ssh
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- 192.168.2.0/24 anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ssh
ACCEPT udp -- anywhere 192.168.2.2 udp dpt:ssh
ACCEPT tcp -- anywhere 192.168.1.2 tcp dpt:ssh
ACCEPT udp -- anywhere 192.168.1.2 udp dpt:ssh
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
cat /etc/resolv.conf:
eth0 Link encap:Ethernet HWaddr 00:10:c6:a6:51:b5
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::210:c6ff:fea6:51b5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20139 errors:0 dropped:0 overruns:0 frame:0
TX packets:12916 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5794540 (5.5 MiB) TX bytes:11961442 (11.4 MiB)
Interrupt:16
eth1 Link encap:Ethernet HWaddr 00:00:1c:d3:96:4a
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::200:1cff:fed3:964a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2713 errors:0 dropped:0 overruns:0 frame:0
TX packets:3711 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:257123 (251.0 KiB) TX bytes:3891358 (3.7 MiB)
Interrupt:21 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:492 (492.0 B) TX bytes:492 (492.0 B)
nameserver 194.204.159.1
nameserver 194.204.152.34
Squid startuje bez problemów:$IPTABLES -A INPUT -s eth1 -d 192.168.2.1 -p tcp --dport 3128 -j ACCEPT
$IPTABLES -I OUTPUT -s eth1 -d 192.168.2.1 -p tcp --sport 3128 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
ale po odpaleniu firewalla przeglądarka nie ładuje stron>> service squid start
[....] Starting Squid HTTP proxy: squid2014/02/07 23:41:15| parseConfigFile: squid.conf:508 unrecognized: 'port'
. ok