LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2006, 06:21 AM   #1
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Rep: Reputation: 30
PREROUTING because it does not function?


All package in door 25 of the interface "eth0" needs to be redirected for door 25 of the IP aliasing "eth1:0 192.168.0.253"


eth0 = internet (10.1.1.2)
eth1 = lan (192.168.0.254)
eth1:0 = ip aliasing (192.168.0.253)

Code:
#!/bin/bash
LAN=192.168.0.0/24
 
modprobe ip_tables
modprobe iptable_filter
modprobe iptable_mangle
modprobe iptable_nat
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
 
iptables -F
iptables -Z
iptables -X
iptables -t nat -F
 
iptables -P INPUT DROP
iptables -P FORWARD DROP
 
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
 
iptables -t mangle -A OUTPUT -o eth0 -p tcp -m multiport --dports 80,22 -j TOS --set-tos 0x10
 
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT  -i lo -j ACCEPT
 
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
 
iptables -A INPUT -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 110 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 143 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 445 -j ACCEPT
 
iptables -A INPUT -i eth1 -p tcp --dport 3128 -j ACCEPT
iptables -A INPUT -i eth1 -p icmp -j ACCEPT
 
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
 
iptables -A FORWARD -i eth0 -p tcp --dport 3389 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 5631 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 5632 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 25 -j ACCEPT
 
iptables -A FORWARD -i eth1 -p tcp --dport 53 -j ACCEPT
iptables -A FORWARD -i eth1 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -i eth1 -p tcp --dport 443 -j ACCEPT
 
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j DNAT --to 192.168.0.253

But it is not functioning, somebody knows the reason?
 
Old 03-20-2006, 03:18 PM   #2
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Original Poster
Rep: Reputation: 30
help please
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PREROUTING does not function with unites... stomach Linux - Networking 5 03-19-2006 03:24 PM
POSTROUTING or PREROUTING czezz Linux - Networking 2 01-23-2006 12:42 PM
prerouting not function stomach Linux - Software 1 12-19-2005 07:16 PM
prerouting question bugstein Linux - Networking 1 04-07-2005 09:49 PM
PREROUTING stuff zalmox Linux - Security 1 11-23-2003 06:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration