LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-05-2005, 06:33 AM   #1
lord_dark
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
Web proxy with a single network card


Hello everybody,
I'm trying to use a server as proxy for another website.
The given server has only one network card. So I just want it to reroute every packet he receive as a web proxy to the given server and vice-versa.
In fact, I try that because the connection between our client computers and the web server are horrfully bad but the connection between the client and the first server and between the first server and the web server are really good, so I hope that with this method I can get a better connection between client and web server.
I tried using iptables, but I get confused in setting the ip forwarding and the nat translation.
Does someone have a clue?

Thanks...
 
Old 12-05-2005, 09:29 AM   #2
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
i don't understand what u mean. how exactly is your setup. is the network cable connected to a hub/switch to which other clients are also connected. If so then configure IP alias on the single network card.

# ifconfig eth0:1 <ip address> netmask <netmask> up
 
Old 12-05-2005, 08:33 PM   #3
lord_dark
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Original Poster
Rep: Reputation: 0
I'll try to explain the situation more clearly.
I want to use a server as web proxy for another web server (no cache needed), but the server with the web proxy as only one network interface.
I tried to use an alias on eth0 call eth0:1 but it doesn't work

Here come the configuration I tried on the proxy server:
eth0 192.168.1.165
eth0:1 192.168.1.166

INTIF="eth0"

EXTIF="eth0:1"

INTIP="192.168.1.165"
EXTIP="192.168.1.166"

/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_nat_irc

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT

iptables -t nat -A POSTROUTING -s $INTIP -j SNAT --to $EXTIP

Thanks.
 
Old 12-05-2005, 09:44 PM   #4
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
alaias in the form of eth0:1 don't work in iptables as far as i know and it will give error here:

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT

Last edited by ~=gr3p=~; 12-05-2005 at 09:46 PM.
 
  


Reply



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
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Networking 1 11-14-2004 11:10 AM
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Wireless Networking 0 11-14-2004 05:27 AM
Single Web Server Do I Really Need To Proxy ?? wylie1001 Linux - Networking 3 08-22-2004 08:27 PM
Network card pings ok, but can't access web via router BeerMonster Linux - Networking 7 11-09-2003 10:46 AM
Mandrake Single Network Firewall and transparent proxy Nucklez Linux - Networking 1 11-29-2001 09:50 PM

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

All times are GMT -5. The time now is 12:35 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