LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-24-2013, 05:57 AM   #1
ninnig1
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
problem with multiple GW e dmz


hi, I have a big problem, I hope for your help.
I have two balanced ADSL: ADSL 1 and ADSL 2. This is the script.

#!/bin/bash

ip route add xx.yy.205.200/255.255.255.248 dev eth0 src xx.yy.205.202 table ADSL1
ip route add default via xx.yy.205.201 table ADSL1

ip route add xx.yy.246.176/255.255.255.248 dev eth1 src xx.yy.246.178 table ADSL2
ip route add default via xx.yy.246.177 table ADSL2

ip rule add from xx.yy.205.202 table ADSL1
ip rule add from xx.yy.246.178 table ADSL2

ip route add 127.0.0.0/8 dev lo table ADSL1
ip route add 127.0.0.0/8 dev lo table ADSL2

ip route add default scope global nexthop via xx.yy.205.201 dev eth0 weight 1 nexthop via xx.yy.246.177 dev eth1 weight 1

ip route flush cache

echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter
echo "0" > /proc/sys/net/ipv4/conf/eth0/rp_filter
echo "0" > /proc/sys/net/ipv4/conf/eth1/rp_filter
echo "0" > /proc/sys/net/ipv4/conf/eth2/rp_filter

Ever since it was to balance the traffic out everything was fine. Now I have the need to publish a server on the LAN on the internet.

The server in question (192.168.1.10) must be published with the address xx.yy.205.202 (ADSL1)

I thought so to set the configuration:

ip rule add fwmark 1 lookup ADSL1

iptables -t nat -A POSTROUTING -s 192.168.1.10 -o eth2 -j MARK --set-mark 1
iptables -t nat -A POSTROUTING -s 192.168.1.10 -o eth0 -j SNAT --to-source xx.yy.205.202
iptables -t nat -A PREROUTING -p tcp -m tcp -d xx.yy.205.202/32 -i eth0 --dport 80 -j DNAT --to-destination 192.168.1.10:80

This configuration don't work !!
the server comes out once the correct interface and once the wrong one

help me please !!!
 
Old 06-25-2013, 05:26 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by ninnig1 View Post
iptables -t nat -A POSTROUTING -s 192.168.1.10 -o eth2 -j MARK --set-mark 1
"POSTROUTING" means the packets have already been routed when you mark them. Have you tried using the PREROUTING chain in the mangle table?
 
  


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
The router with the function of DMZ ? What is DMZ? wertum Linux - Networking 3 08-10-2010 04:05 AM
Howto setup iptables firewall and DMZ with multiple public IP's ? hendrixx Linux - Networking 2 11-30-2008 08:03 AM
Remote desktop dmz problem satish Linux - Networking 0 06-27-2008 06:47 AM
question about iptables (DMZ machine connect to other DMZ machine 's publuic IP) wingmak Linux - Security 1 01-20-2007 04:01 PM
Multiple web servers on DMZ...is that possible? depam Linux - Software 3 07-24-2006 02:48 PM

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

All times are GMT -5. The time now is 05:33 PM.

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