From: "Wennie V. Lagmay" Subject: Re: routing within same nic card Date: Tue, 31 May 2005 09:51:25 +0300 Message-ID: <00e801c565ad$29c91a00$d40aa8c0@winxp> References: <000a01c565a0$867deee0$d40aa8c0@winxp> <429BFAE6.90200@riverviewtech.net><00ca01c565a7$759eeaa0$d40aa8c0@winxp> <429C04B1.60208@riverviewtech.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-bounces@lists.netfilter.org Errors-To: netfilter-bounces@lists.netfilter.org Content-Type: text/plain; format="flowed"; charset="us-ascii"; reply-type="response" To: "Taylor, Grant" , netfilter@lists.netfilter.org Grant, Below is my existing config: *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -i ! eth1 -j ACCEPT -A INPUT -p icmp -m state --state NEW -m icmp --icmp-type 8 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 69 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 953 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT -A INPUT -p tcp -j REJECT --reject-with tcp-reset -A INPUT -p udp -j REJECT --reject-with icmp-net-prohibited -A INPUT -j DROP -A FORWARD -s 192.168.10.0/255.255.255.0 -j ACCEPT -A FORWARD -d 192.168.10.0/255.255.255.0 -j ACCEPT -A FORWARD -s 192.168.11.0/255.255.255.0 -j ACCEPT -A FORWARD -d 192.168.11.0/255.255.255.0 -j ACCEPT -A FORWARD -s 192.169.10.0/255.255.255.0 -j ACCEPT -A FORWARD -d 192.169.10.0/255.255.255.0 -j ACCEPT -A FORWARD -s 212.119.xxx.104/255.255.255.248 -j ACCEPT -A FORWARD -d 212.119.xxx.104/255.255.255.248 -j ACCEPT -A FORWARD -s 212.119.xxx.112/255.255.255.248 -j ACCEPT -A FORWARD -d 212.119.xxx.112/255.255.255.248 -j ACCEPT -A FORWARD -s 192.168.3.0/255.255.255.192 -d 212.119.xxx.104/255.255.255.248 -j ACCEPT <<< To: Sent: Tuesday, May 31, 2005 9:31 AM Subject: Re: routing within same nic card >> Presently I have 2 NIC cards; >> eth1 = 212.119.xxx.98/30 directly connected to internet >> eth0 = 212.119.xxx.105/29 connected to LAN, with this setup everything is >> working fine >> >> now I need to add another network, since I cannot Add another NIC card, >> my solution is like this >> eth1 = 212.119.xxx.98/30 directly connected to internet >> eth0 = 212.119.xxx.105/29 connected to LAN1 >> eth0:1 = 192.168.3.0/26 connected to LAN2 > > This seems reasonable enough. > >> I already done the 3 lines below >> sysctl -w net.ipv4.ip_forward=1 >> iptables -A FORWARD -s 192.168.3.0/26 -d 212.119.xxx.104/29 -j ACCEPT >> iptables -A FORWARD -s 212.119.xxx.104/29 -d 192.168.3.0/26 -j ACCEPT > > This should also work as it allows traffic between the 192.168.3.0/26 > 212.119.xxx.104/29 networks. I would need to see the contents of your nat > table POSTROUTING chain to make sure that you would not be NATing traffic > that you would not want. Other than that I don't think you would have any > problems. Seeing as how you are not filtering based on interface I don't > think you will have any issues with it. > > > > Grant. . . . >