Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-05-2005, 06:33 AM
|
#1
|
LQ Newbie
Registered: Dec 2005
Posts: 2
Rep:
|
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...
|
|
|
12-05-2005, 09:29 AM
|
#2
|
Member
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227
Rep:
|
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
|
|
|
12-05-2005, 08:33 PM
|
#3
|
LQ Newbie
Registered: Dec 2005
Posts: 2
Original Poster
Rep:
|
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.
|
|
|
12-05-2005, 09:44 PM
|
#4
|
Member
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 05:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|