Networking Forums

Networking Forums > Computer Networking > Linux Networking > IPTABLES, router, and proxy server...

Reply
Thread Tools Display Modes

IPTABLES, router, and proxy server...

 
 
Edward Cho [387036]
Guest
Posts: n/a

 
      06-24-2004, 02:57 AM
Hi...

Even though this involves a router problem, it also involves IPTABLES (which
is the primary problem). I am using the Sveasoft firmware which allows me
to TELNET into the router and set-up the IPTABLES. The firmware is awesome
(using the latest 3.11), but I'm having trouble sending all my web traffic
(port 80) to an external outside proxy server (on a different port). This
was my guess:

# Clear all iptables
iptables --flush
iptables --delete-chain

# Masquerade
iptables -t nat -A POSTROUTING -o vlan1 -j MASQUERADE

# Transparent Proxy
# iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j
REDIRECT --to-port 8902

# Transparent Proxy (to a Remote Box)
iptables -t nat -A PREROUTING -i br0 -s ! 192.168.1.1 -p tcp --dport 80 -j
DNAT --to 209.197.41.4:8902
iptables -t nat -A POSTROUTING -o vlan1 -s 192.168.1.0/26 -d 209.197.41.4 -j
SNAT --to 192.168.1.1
iptables -A FORWARD -s 192.168.1.0/26 -d 209.197.41.4 -i br0 -o vlan1 -p
tcp --dport 80 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 110 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 143 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -i vlan1 -p tcp --dport 8902 -j ACCEPT

Notes: The input interface is br0 and the output interface is vlan1
according to Sveasoft. What's even worse is that i can't access the web
interface (192.168.1.1) and if I disconnect the TELNET from the router ... I
can't reconnect. If i stay connected, I can recover by entering this
command:

iptables -F
iptables -t nat -I PREROUTING -i + -s 192.168.1.100/26 -p tcp --dport 80 -j
ACCEPT

then going to 192.168.1.1 and saving the settings. Any help would be much
appreciated! Thanks!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables proxy on a single interface Monterey IT Guy Linux Networking 0 02-08-2007 10:16 PM
iptables, proxy ftp via frox jacob.saxberg@gmail.com Linux Networking 0 04-06-2006 01:20 PM
iptables proxy two ips for one host Fritz Bayer Linux Networking 2 07-12-2004 06:50 AM
iptables transparent proxy Cameron Kerr Linux Networking 7 06-14-2004 08:57 AM
Proxy and iptables Francesc Llop Linux Networking 1 04-21-2004 07:57 AM



1 2 3 4 5 6 7 8 9 10 11