23-01-2005, 09:29
|
|
|
חבר מתאריך: 02.11.04
הודעות: 186
|
|
I changed to 192.168.0.2 on one card
The ifconfig shows:
קוד:
eth0 Link encap:Ethernet HWaddr 00:10:95:A4:EC:E2
inet addr:172.23.91.223 Bcast:255.255.255.255 Mask:255.255.224.0
inet6 addr: fe80::210:95ff:fea4:ece2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:113016 errors:0 dropped:0 overruns:0 frame:0
TX packets:55639 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14514262 (13.8 MiB) TX bytes:14732331 (14.0 MiB)
eth1 Link encap:Ethernet HWaddr 00:50:BF:DA:C4:A7
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:bfff:feda:c4a7/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10305 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:618612 (604.1 KiB)
Interrupt:10 Base address:0xd400
eth2 Link encap:Ethernet HWaddr 00:10:4B:3E:88:51
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::210:4bff:fe3e:8851/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35796 errors:0 dropped:0 overruns:0 frame:0
TX packets:21290 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12137467 (11.5 MiB) TX bytes:7683099 (7.3 MiB)
Interrupt:11 Base address:0xd000
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:552 (552.0 b) TX bytes:552 (552.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.114.82.215 P-t-P:192.117.122.13 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1460 Metric:1
RX packets:12902 errors:0 dropped:0 overruns:0 frame:0
TX packets:22646 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1133808 (1.0 MiB) TX bytes:3904632 (3.7 MiB)
my iptables --list shows:
קוד:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- localhost.localdomain localhost.localdomain
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:1723
ACCEPT tcp -- anywhere anywhere tcp dpt:4662
ACCEPT udp -- anywhere anywhere udp dpt:4672
DROP all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
DROP all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
And my firewall script is:
קוד:
#! /bin/sh -f
iptables --flush
iptables --flush -t nat
iptables --delete-chain
iptables -P INPUT DROP
iptables -A INPUT -i lo --source 127.0.0.1 --destination 127.0.0.1 -j ACCEPT
iptables -A INPUT -m state --state "ESTABLISHED,RELATED" -j ACCEPT
iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i ppp0 -p tcp --dport 4662 -j ACCEPT
iptables -A INPUT -i ppp0 -p udp --dport 4672 -j ACCEPT
iptables -A INPUT -j DROP
iptables -P OUTPUT ACCEPT
iptables -A OUTPUT -j ACCEPT
iptables -P FORWARD DROP
iptables -A FORWARD -i eth1 -o ppp0 -j ACCEPT
iptables -A FORWARD -i eth2 -o ppp0 -j ACCEPT
iptables -A FORWARD -i ppp0 -o eth1 -m state --state "ESTABLISHED,RELATED" -j ACCEPT
iptables -A FORWARD -i ppp0 -o eth2 -m state --state "ESTABLISHED,RELATED" -j ACCEPT
iptables -A FORWARD -j DROP
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
exit 0
Thanks, Alexander.
_____________________________________
בברכה, אלכסנדר.
"The object of war is not to die for your country but to make the other bastard die for his" - General George S Patton
|