Se da:
Un PC pe post de router (GW), cu RH 8.0, 3 interfete de retea:
- prima - iesire spre net 10.5.6.100 Mask
255.0.0.0
- a doua spre un calculator local 192.168.1.1 mask
255.255.255.0
- a treia tot spre un calculator local 192.168.2.1 mask
255.255.255.0
eu vreau ca:
- cele doua calculatoare legate la GW sa aiba net (s-a rezolvat)
- cele doua calculatoare sa se vada intre ele (nu am reusit). Pe
ambele calculatoare windows xp sp1
calc1 192.168.1.2 mask 255.255.255.0 gw 192.168.1.1
calc2 192.168.2.2 mask 255.255.255.0 gw 192.168.2.1
nu merge ping de la calc1 la calc2 (nici reciproc)
merge ping de la fiecare calc la interfata incrucisata (ex. De la
192.168.2.2 la 192.168.1.1) si evident la gw setat pt el
merge ping de la gw la calc1 respectiv calc2
scriptul de IPTables de pe GW este:
# starting the rules
echo -e "Starting the fucking firewall broa :) .... .... ...."
# fluhes the rules in the filter and NAT tables
iptables --flush
iptables --table nat --flush
# delete chains that are not in default filter and NAT table
iptables --delete-chain
iptables --table nat --delete-chain
# setup the forwarding and masquerading
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
iptables --append FORWARD --in-interface eth2 -j ACCEPT
# that's all
Iar interfetele sunt:
eth0 Link encap:Ethernet HWaddr 00:E0:7D:93:1D:EE
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10072 errors:0 dropped:0 overruns:0 frame:0
TX packets:10979 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1325594 (1.2 Mb) TX bytes:8587050 (8.1 Mb)
Interrupt:10 Base address:0x9000
eth1 Link encap:Ethernet HWaddr 00:00:21:2A:B1:3C
inet addr:10.4.7.110 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14880265 errors:0 dropped:0 overruns:0 frame:0
TX packets:2899538 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2915343780 (2780.2 Mb) TX bytes:373817316 (356.4 Mb)
Interrupt:5 Base address:0xb000
eth2 Link encap:Ethernet HWaddr 00:50:FC:ED:F8:37
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2893300 errors:0 dropped:0 overruns:0 frame:0
TX packets:4915111 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:373360547 (356.0 Mb) TX bytes:2299428864 (2192.9 Mb)
Interrupt:9 Base address:0xd000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1871 errors:0 dropped:0 overruns:0 frame:0
TX packets:1871 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:247095 (241.3 Kb) TX bytes:247095 (241.3 Kb)
---
Detalii despre listele noastre de mail: http://www.lug.ro/