Weird problem
I just setup a new netfilter firewall and I'm having a weird problem with it. After it was setup I plugged the network cables in it then tried to access a random ftp site on the internet, it didn't work. So I tried pinging the interfaces on the firewall, I could ping them all. Then I tried pinging the router to the net but nothing, then I sshed into another computer that's on the same subnet as the router and it worked, so I try pinging the router again and it worked. So I tested a few things on the net and everything seemed to work fine, from MY workstation. So I tried on another computer and I still couldn't ping the router, pinged the other computer that's on the same subnet as the router and it worked, then I could ping the router and had access to the net. Anybody has an idea why I have to connect to another computer before I can reach the router?
Jean-Rene Cormier
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines
Here are the rules I'm using:
*nat
:PREROUTING ACCEPT [242:28183]
:POSTROUTING ACCEPT [63:13135]
:OUTPUT ACCEPT [9:3439](quoted diff) +0
-6-A PREROUTING -d 123.123.123.2 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.3 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.7 -j DNAT --to-destination 192.168.0.6 -A PREROUTING -d 123.123.123.10 -j DNAT --to-destination 192.168.0.4 -A PREROUTING -d 123.123.123.12 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.13 -j DNAT --to-destination 192.168.0.8
Review
Quoted 10 lines
(quoted diff) +0
-10-A PREROUTING -d 123.123.123.51 -j DNAT --to-destination 192.168.1.51 -A PREROUTING -d 123.123.123.52 -j DNAT --to-destination 192.168.1.52 -A PREROUTING -d 123.123.123.53 -j DNAT --to-destination 192.168.1.53 -A PREROUTING -d 123.123.123.54 -j DNAT --to-destination 192.168.1.54 -A PREROUTING -d 123.123.123.55 -j DNAT --to-destination 192.168.1.55 -A PREROUTING -d 123.123.123.56 -j DNAT --to-destination 192.168.1.56 -A PREROUTING -d 123.123.123.57 -j DNAT --to-destination 192.168.1.57 -A PREROUTING -d 123.123.123.58 -j DNAT --to-destination 192.168.1.58 -A PREROUTING -d 123.123.123.59 -j DNAT --to-destination 192.168.1.59 -A PREROUTING -d 123.123.123.60 -j DNAT --to-destination 192.168.1.60
Are your internal boxes going to be servers? You generally don't need DNAT unless the outside needs access to the private lan boxes.
Quoted 32 lines
(quoted diff) +0
-5-A POSTROUTING -s 192.168.0.2 -o eth0 -j SNAT --to-source 123.123.123.12 -A POSTROUTING -s 192.168.0.6 -o eth0 -j SNAT --to-source 123.123.123.7 -A POSTROUTING -s 192.168.0.8 -o eth0 -j SNAT --to-source 123.123.123.13 -A POSTROUTING -s 192.168.0.4 -o eth0 -j SNAT --to-source 123.123.123.10 -A POSTROUTING -s 192.168.1.51 -o eth0 -j SNAT --to-source123.123.123.51
-A POSTROUTING -s 192.168.1.52 -o eth0 -j SNAT --to-source 123.123.123.52
-A POSTROUTING -s 192.168.1.53 -o eth0 -j SNAT --to-source 123.123.123.53
-A POSTROUTING -s 192.168.1.54 -o eth0 -j SNAT --to-source 123.123.123.54
-A POSTROUTING -s 192.168.1.55 -o eth0 -j SNAT --to-source 123.123.123.55
-A POSTROUTING -s 192.168.1.56 -o eth0 -j SNAT --to-source 123.123.123.56
-A POSTROUTING -s 192.168.1.57 -o eth0 -j SNAT --to-source 123.123.123.57
-A POSTROUTING -s 192.168.1.58 -o eth0 -j SNAT --to-source 123.123.123.58
-A POSTROUTING -s 192.168.1.59 -o eth0 -j SNAT --to-source 123.123.123.59
-A POSTROUTING -s 192.168.1.60 -o eth0 -j SNAT --to-source 123.123.123.60
COMMIT*filter
:INPUT DROP [61:8249]
:FORWARD DROP [72:4535]
:OUTPUT DROP [0:0]
Review
Quoted 6 lines
(quoted diff) +0
-6-A INPUT -i lo -j ACCEPT -A INPUT -d 123.123.123.254 -j ACCEPT -A INPUT -d 192.168.0.1 -j ACCEPT -A INPUT -d 192.168.1.1 -j ACCEPT -A FORWARD -i eth2 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT -A FORWARD -o eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
These should be on the external interface. Your ip addr shows this as a lan interface. I think you've assigned either the rules or the IPs to the wrong interfaces.
Review
Quoted 6 lines
(quoted diff) +0
-4-A FORWARD -d 192.168.0.6 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -d 192.168.0.8 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -i eth0 -o eth1 -j ACCEPT -A FORWARD -i eth1 -o eth0 -j ACCEPT
Your treating these as local interfaces, but eth0 is your external interface.
Quoted 77 lines
(quoted diff) +0
-4-A OUTPUT -o lo -j ACCEPT -A OUTPUT -s 123.123.123.254 -j ACCEPT -A OUTPUT -s 192.168.0.1 -j ACCEPT -A OUTPUT -s 192.168.1.1 -j ACCEPTCOMMIT
The way the network is setup is we have a Cisco router (owned by our ISP) that goes to the internet with IP 123.123.123.1 and the netfilter box has IP 123.123.123.254 on the external interface. I'm using 192.168.0.0/24 and 192.168.1.0/24 on the internal interfaces. My workstation is in the 192.168.1.0/24 subnet and when I was trying to ping the Cisco router, it wouldn't work but I could ping another computer on the 123.123.123.0/24 subnet and after that I could ping the router and everything worked. Also there's a few people who couldn't connect to the net even after I tried pinging a computer in the 123.123.123.0/24 subnet, when I turned on logging in the FORWARD table for their IPs it started working and I could remove that rules afterwards and it would continue to work. I setup the rules pretty basic for now to make sure everything works before I start locking stuff out.
Here's the output of ip addr show on the netfilter box:
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f8 brd ff:ff:ff:ff:ff:ff inet 123.123.123.254/24 brd 123.123.123.255 scope global eth0 inet 123.123.123.2/32 scope global eth0
inet 123.123.123.3/32 scope global eth0
inet 123.123.123.7/32 scope global eth0
inet 123.123.123.10/32 scope global eth0
inet 123.123.123.12/32 scope global eth0
inet 123.123.123.13/32 scope global eth0
inet 123.123.123.51/32 scope global eth0
inet 123.123.123.52/32 scope global eth0
inet 123.123.123.53/32 scope global eth0
inet 123.123.123.54/32 scope global eth0
inet 123.123.123.55/32 scope global eth0
inet 123.123.123.56/32 scope global eth0
inet 123.123.123.57/32 scope global eth0
inet 123.123.123.58/32 scope global eth0
inet 123.123.123.59/32 scope global eth0
inet 123.123.123.60/32 scope global eth0
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f9 brd ff:ff:ff:ff:ff:ff inet 192.168.0.1/24 brd 192.168.0.255 scope global eth1
4: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:77:d2 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth2And here's the output of ip route show:
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.1 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1123.123.123.0/24 dev eth0 proto kernel scope link src 123.123.123.254 default via 123.123.123.1 dev eth0
Quoted 5 lines
If your not experienced with iptables this is an excellent tutorial which explains in detail how iptables works: http://iptables-tutorial.frozentux.net/
If you are experienced, you need to insert some logging rules to find out where the packets are going to. Snort can also help with this.
I have some experience with iptables but I don't consider myself an expert.
Jean-Rene Cormier
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 17 lines · Jeffrey Laramie
Quoted 17 lines
Here are the rules I'm using:
*nat
:PREROUTING ACCEPT [242:28183]
:POSTROUTING ACCEPT [63:13135]
:OUTPUT ACCEPT [9:3439](quoted diff) +0
-11-A PREROUTING -d 123.123.123.2 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.3 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.7 -j DNAT --to-destination 192.168.0.6 -A PREROUTING -d 123.123.123.10 -j DNAT --to-destination 192.168.0.4 -A PREROUTING -d 123.123.123.12 -j DNAT --to-destination 192.168.0.2 -A PREROUTING -d 123.123.123.13 -j DNAT --to-destination 192.168.0.8 -A PREROUTING -d 123.123.123.51 -j DNAT --to-destination 192.168.1.51 -A PREROUTING -d 123.123.123.52 -j DNAT --to-destination 192.168.1.52 -A PREROUTING -d 123.123.123.53 -j DNAT --to-destination 192.168.1.53 -A PREROUTING -d 123.123.123.54 -j DNAT --to-destination 192.168.1.54 -A PREROUTING -d 123.123.123.55 -j DNAT --to-destination 192.168.1.55
Quoted 9 lines
Review
Quoted 6 lines
(quoted diff) +0
-5-A PREROUTING -d 123.123.123.56 -j DNAT --to-destination 192.168.1.56 -A PREROUTING -d 123.123.123.57 -j DNAT --to-destination 192.168.1.57 -A PREROUTING -d 123.123.123.58 -j DNAT --to-destination 192.168.1.58 -A PREROUTING -d 123.123.123.59 -j DNAT --to-destination 192.168.1.59 -A PREROUTING -d 123.123.123.60 -j DNAT --to-destination 192.168.1.60Are your internal boxes going to be servers? You generally don't need DNAT unless the outside needs access to the private lan boxes.
I just use DNAT because that's the only way I got it to work the first time I tried it so I used the same setup for the new firewall. Also sometimes there are a few people that want to connect to there boxes from outside with VNC or FTP.
Quoted 26 lines
Quoted 26 lines
(quoted diff) +0
-5-A POSTROUTING -s 192.168.0.2 -o eth0 -j SNAT --to-source 123.123.123.12 -A POSTROUTING -s 192.168.0.6 -o eth0 -j SNAT --to-source 123.123.123.7 -A POSTROUTING -s 192.168.0.8 -o eth0 -j SNAT --to-source 123.123.123.13 -A POSTROUTING -s 192.168.0.4 -o eth0 -j SNAT --to-source 123.123.123.10 -A POSTROUTING -s 192.168.1.51 -o eth0 -j SNAT --to-source123.123.123.51
-A POSTROUTING -s 192.168.1.52 -o eth0 -j SNAT --to-source 123.123.123.52
-A POSTROUTING -s 192.168.1.53 -o eth0 -j SNAT --to-source 123.123.123.53
-A POSTROUTING -s 192.168.1.54 -o eth0 -j SNAT --to-source 123.123.123.54
-A POSTROUTING -s 192.168.1.55 -o eth0 -j SNAT --to-source 123.123.123.55
-A POSTROUTING -s 192.168.1.56 -o eth0 -j SNAT --to-source 123.123.123.56
-A POSTROUTING -s 192.168.1.57 -o eth0 -j SNAT --to-source 123.123.123.57
-A POSTROUTING -s 192.168.1.58 -o eth0 -j SNAT --to-source 123.123.123.58
-A POSTROUTING -s 192.168.1.59 -o eth0 -j SNAT --to-source 123.123.123.59
-A POSTROUTING -s 192.168.1.60 -o eth0 -j SNAT --to-source 123.123.123.60
COMMIT
Quoted 16 lines
Review
Quoted 12 lines
*filter
:INPUT DROP [61:8249]
:FORWARD DROP [72:4535]
:OUTPUT DROP [0:0](quoted diff) +0
-6-A INPUT -i lo -j ACCEPT -A INPUT -d 123.123.123.254 -j ACCEPT -A INPUT -d 192.168.0.1 -j ACCEPT -A INPUT -d 192.168.1.1 -j ACCEPT -A FORWARD -i eth2 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT -A FORWARD -o eth2 -m state --state RELATED,ESTABLISHED -j ACCEPTThese should be on the external interface. Your ip addr shows this as a lan interface. I think you've assigned either the rules or the IPs to the wrong interfaces.
Does it make a difference if I put it on eth0 or eth2? The thing is I don't want new connections from eth1 to enter eth2 that's why I put the stateful stuff on eth2.
Quoted 9 lines
Review
Quoted 6 lines
(quoted diff) +0
-4-A FORWARD -d 192.168.0.6 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -d 192.168.0.8 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -i eth0 -o eth1 -j ACCEPT -A FORWARD -i eth1 -o eth0 -j ACCEPTYour treating these as local interfaces, but eth0 is your external interface.
What I want here is that packets from eth0 to eth1 is allowed to go through and from eth1 to eth0 is allowed to go through also but I don't want incoming connections from the internet to port 25 on these 2 boxes. So I thought that those lines would block connections coming into eth0 and since the PREROUTING stuff is passed through before the FORWARD, I put the internal IP addresses.
Thanks for your help!
Jean-Rene Cormier
Quoted 73 lines
Quoted 73 lines
(quoted diff) +0
-4-A OUTPUT -o lo -j ACCEPT -A OUTPUT -s 123.123.123.254 -j ACCEPT -A OUTPUT -s 192.168.0.1 -j ACCEPT -A OUTPUT -s 192.168.1.1 -j ACCEPTCOMMIT
The way the network is setup is we have a Cisco router (owned by our ISP) that goes to the internet with IP 123.123.123.1 and the netfilter box has IP 123.123.123.254 on the external interface. I'm using 192.168.0.0/24 and 192.168.1.0/24 on the internal interfaces. My workstation is in the 192.168.1.0/24 subnet and when I was trying to ping the Cisco router, it wouldn't work but I could ping another computer on the 123.123.123.0/24 subnet and after that I could ping the router and everything worked. Also there's a few people who couldn't connect to the net even after I tried pinging a computer in the 123.123.123.0/24 subnet, when I turned on logging in the FORWARD table for their IPs it started working and I could remove that rules afterwards and it would continue to work. I setup the rules pretty basic for now to make sure everything works before I start locking stuff out.
Here's the output of ip addr show on the netfilter box:
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f8 brd ff:ff:ff:ff:ff:ff inet 123.123.123.254/24 brd 123.123.123.255 scope global eth0 inet 123.123.123.2/32 scope global eth0
inet 123.123.123.3/32 scope global eth0
inet 123.123.123.7/32 scope global eth0
inet 123.123.123.10/32 scope global eth0
inet 123.123.123.12/32 scope global eth0
inet 123.123.123.13/32 scope global eth0
inet 123.123.123.51/32 scope global eth0
inet 123.123.123.52/32 scope global eth0
inet 123.123.123.53/32 scope global eth0
inet 123.123.123.54/32 scope global eth0
inet 123.123.123.55/32 scope global eth0
inet 123.123.123.56/32 scope global eth0
inet 123.123.123.57/32 scope global eth0
inet 123.123.123.58/32 scope global eth0
inet 123.123.123.59/32 scope global eth0
inet 123.123.123.60/32 scope global eth0
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f9 brd ff:ff:ff:ff:ff:ff inet 192.168.0.1/24 brd 192.168.0.255 scope global eth1
4: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:77:d2 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth2And here's the output of ip route show:
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.1 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1123.123.123.0/24 dev eth0 proto kernel scope link src 123.123.123.254 default via 123.123.123.1 dev eth0
Quoted 8 lines
If your not experienced with iptables this is an excellent tutorial which explains in detail how iptables works:
http://iptables-tutorial.frozentux.net/If you are experienced, you need to insert some logging rules to find out where the packets are going to. Snort can also help with this.
I have some experience with iptables but I don't consider myself an expert.
Quoted 47 lines
Quoted 36 lines
Quoted 36 lines
(quoted diff) +0
-5-A POSTROUTING -s 192.168.0.2 -o eth0 -j SNAT --to-source 123.123.123.12 -A POSTROUTING -s 192.168.0.6 -o eth0 -j SNAT --to-source 123.123.123.7 -A POSTROUTING -s 192.168.0.8 -o eth0 -j SNAT --to-source 123.123.123.13 -A POSTROUTING -s 192.168.0.4 -o eth0 -j SNAT --to-source 123.123.123.10 -A POSTROUTING -s 192.168.1.51 -o eth0 -j SNAT --to-source123.123.123.51
-A POSTROUTING -s 192.168.1.52 -o eth0 -j SNAT --to-source 123.123.123.52
-A POSTROUTING -s 192.168.1.53 -o eth0 -j SNAT --to-source 123.123.123.53
-A POSTROUTING -s 192.168.1.54 -o eth0 -j SNAT --to-source 123.123.123.54
-A POSTROUTING -s 192.168.1.55 -o eth0 -j SNAT --to-source 123.123.123.55
-A POSTROUTING -s 192.168.1.56 -o eth0 -j SNAT --to-source 123.123.123.56
-A POSTROUTING -s 192.168.1.57 -o eth0 -j SNAT --to-source 123.123.123.57
-A POSTROUTING -s 192.168.1.58 -o eth0 -j SNAT --to-source 123.123.123.58
-A POSTROUTING -s 192.168.1.59 -o eth0 -j SNAT --to-source 123.123.123.59
-A POSTROUTING -s 192.168.1.60 -o eth0 -j SNAT --to-source 123.123.123.60
COMMIT*filter
:INPUT DROP [61:8249]
:FORWARD DROP [72:4535]
:OUTPUT DROP [0:0](quoted diff) +0
-5-A INPUT -i lo -j ACCEPT -A INPUT -d 123.123.123.254 -j ACCEPT -A INPUT -d 192.168.0.1 -j ACCEPT -A INPUT -d 192.168.1.1 -j ACCEPT -A FORWARD -i eth2 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPTQuoted 10 lines
Quoted 5 lines
-A FORWARD -o eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
These should be on the external interface. Your ip addr shows this as a lan interface. I think you've assigned either the rules or the IPs to the wrong interfaces.
Quoted 5 lines
Does it make a difference if I put it on eth0 or eth2? The thing is I don't want new connections from eth1 to enter eth2 that's why I put the stateful stuff on eth2.
It doesn't matter to iptables which interface is internal or external as long as the internal iface has a local IP and the external has a public IP. In your rules you're treating eth2 as the public interface, but based on the output below, you have a private IP assigned to it. See below:
Quoted 49 lines
Quoted 14 lines
Review
Quoted 10 lines
(quoted diff) +0
-4-A FORWARD -d 192.168.0.6 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -d 192.168.0.8 -i eth0 -p tcp -m tcp --dport 25 -j DROP -A FORWARD -i eth0 -o eth1 -j ACCEPT -A FORWARD -i eth1 -o eth0 -j ACCEPTYour treating these as local interfaces, but eth0 is your external interface.
What I want here is that packets from eth0 to eth1 is allowed to go through and from eth1 to eth0 is allowed to go through also but I don't want incoming connections from the internet to port 25 on these 2 boxes. So I thought that those lines would block connections coming into eth0 and since the PREROUTING stuff is passed through before the FORWARD, I put the internal IP addresses.
Thanks for your help!
Jean-Rene Cormier
Quoted 20 lines
Quoted 20 lines
(quoted diff) +0
-4-A OUTPUT -o lo -j ACCEPT -A OUTPUT -s 123.123.123.254 -j ACCEPT -A OUTPUT -s 192.168.0.1 -j ACCEPT -A OUTPUT -s 192.168.1.1 -j ACCEPTCOMMIT
The way the network is setup is we have a Cisco router (owned by our ISP) that goes to the internet with IP 123.123.123.1 and the netfilter box has IP 123.123.123.254 on the external interface. I'm using 192.168.0.0/24 and 192.168.1.0/24 on the internal interfaces. My workstation is in the 192.168.1.0/24 subnet and when I was trying to ping the Cisco router, it wouldn't work but I could ping another computer on the 123.123.123.0/24 subnet and after that I could ping the router and everything worked. Also there's a few people who couldn't connect to the net even after I tried pinging a computer in the 123.123.123.0/24 subnet, when I turned on logging in the FORWARD table for their IPs it started working and I could remove that rules afterwards and it would continue to work. I setup the rules pretty basic for now to make sure everything works before I start locking stuff out.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Here's the output of ip addr show on the netfilter box:
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
loopback is fine
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc
pfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f8 brd ff:ff:ff:ff:ff:ff
inet 123.123.123.254/24 brd 123.123.123.255 scope global eth0 inet 123.123.123.2/32 scope global eth0
inet 123.123.123.3/32 scope global eth0
inet 123.123.123.7/32 scope global eth0
inet 123.123.123.10/32 scope global eth0
inet 123.123.123.12/32 scope global eth0
inet 123.123.123.13/32 scope global eth0
inet 123.123.123.51/32 scope global eth0
inet 123.123.123.52/32 scope global eth0
inet 123.123.123.53/32 scope global eth0
inet 123.123.123.54/32 scope global eth0
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
inet 123.123.123.55/32 scope global eth0
inet 123.123.123.56/32 scope global eth0
inet 123.123.123.57/32 scope global eth0
inet 123.123.123.58/32 scope global eth0
inet 123.123.123.59/32 scope global eth0
inet 123.123.123.60/32 scope global eth0
Your rules show eth0 as a private interface, but this shows it with public IPs.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc
pfifo_fastqlen 100
link/ether 00:04:23:5f:8f:f9 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global eth1
4: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdiscpfifo_fastqlen 100
link/ether 00:04:23:5f:77:d2 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global eth2
Your rules treat eth2 as the public interface, but here ip addr shows it has been assigned a private IP address. You need to make sure that the interface which is physically connected to the ISP has a public IP and that your rules match the physical connections. Try logging all traffic through each interface for a few minutes then review the log. You should be able to see which interface is actually facing the router and which ones are facing the lan. Then adjust your rules and IP addresses to match the physical connections.
Jeff