Need help with multiple WAN IPs routed to internal IPs

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3
Author Message
Patrice Tremblay
DD-WRT Novice


Joined: 09 Apr 2009
Posts: 16

PostPosted: Thu Apr 09, 2009 13:40    Post subject: Reply with quote
I'm sorry but, like you can see, i'm not an expert.

Which build is the best to use?


I updated for v24 sp2 and i can now do the snat command but i hit a block at the same point.

When i enter one of my public ip in browser, i'm getting into the router.

It's seems that the forwarding rules are not applied.

Do i need to click ''save firwall'' or ''save startup'' after each rule that i setup ?

If yes, when i do it, i just have the last rule sticked up in the form.

If not, it dont work much more.


If it's possible to help me, i will appreciate a lot.


Thanks!
Sponsor
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Apr 09, 2009 15:41    Post subject: Reply with quote
You should enter all of the commands at once and save it to the firewall or click on the edit button of the firewall script and then add to it and save again. If your getting the router when you type in one of the ip's that you have 1:1 nat'd then the DNAT commands were likely erased.
Patrice Tremblay
DD-WRT Novice


Joined: 09 Apr 2009
Posts: 16

PostPosted: Thu Apr 09, 2009 16:09    Post subject: Reply with quote
Same thing...

All the commands need to be putted in the firewall?

Also the startup command and the last port forwarding command ?

or

the startup command need to be saved in the startup and the port forwarding at custom script?


I really dont understand why isnt more simple when it's something that sould be seen almost everyday..


Thanks for your help!
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Apr 09, 2009 16:50    Post subject: Reply with quote
The ifconfig commands can go in your startup script but you'll need to run them or reboot for them to take effect. The iptables commands all need to go into the firewall script. I would suggest running it in a shell (telnet in) first and once you have it working then save the scripts in the web ui. Also see the wiki page, it mostly just repeats things but might make more sense.

http://www.dd-wrt.com/wiki/index.php/Static_NAT
Patrice Tremblay
DD-WRT Novice


Joined: 09 Apr 2009
Posts: 16

PostPosted: Thu Apr 09, 2009 16:57    Post subject: Reply with quote
Your help is appreciated!

For the shell or telnet, i tried it a little earlier but another problem was there.

My password is always refused..

I tried to setup a simple one without exotic characters in thinking that it may be an encoding problem but it dont work much more.

I will read the stuff your link is pointing in hope that it will help me.

Thanks another time. I'll come back with feedbacks little later.


Bye.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Apr 09, 2009 17:00    Post subject: Reply with quote
The shell login user is always root but the password is the same as you configured for the web ui.
Patrice Tremblay
DD-WRT Novice


Joined: 09 Apr 2009
Posts: 16

PostPosted: Thu Apr 09, 2009 17:36    Post subject: Reply with quote
Ok.

I already readed that tutorial before asking questions and nothing is working more.

I can telnet with user root but after all...the requests stop at the router.

Do i need an hammer?

:lol:



Is it possible that the problem come from a bad broadcast adress?

Do i need the lan broadcast adress or the wan ones provided by my isp?

I used that tool to found it:

http://www.tech-faq.com/calculate-broadcast-address.shtml


And i also used the wan broadcast adress..
Patrice Tremblay
DD-WRT Novice


Joined: 09 Apr 2009
Posts: 16

PostPosted: Sun Apr 12, 2009 6:23    Post subject: Reply with quote
I didnt try and i'll can not until next week but is it also possible for a reason that i just can't be able to reach the server in loopback from the the same network?

I'm sorry to ask so many questions. It's just so many new parameters here.

Thanks!
mnour.tamer
DD-WRT Novice


Joined: 18 May 2012
Posts: 45

PostPosted: Mon May 28, 2012 14:01    Post subject: Reply with quote
Hi

thanks for your help

I have Asus router N-16 with dd-wrt version 18777
I am using the built-in chilli .

my problem is that after confgiuring chilli with 3G stick it didn.t redirect me o the desired page .

I searched the Wiki and in one of the subject i found that i have to insert the following command that is missing in version 17000 - 18777 which is related to NAT .

this command is : iptables -t nat -I POSTROUTING -o `get_wanface` -j SNAT --to `nvram get wan_ipaddr`

i configured it in dd-wrt command interface and saved it in firewall .

now it redirected me to the desired page but id i press go it did nothing , giving me the error code 605 failed to connect , please try again .

so what should I do ?
aesthetiker
DD-WRT Novice


Joined: 16 Apr 2015
Posts: 1

PostPosted: Sat Apr 18, 2015 11:52    Post subject: Reply with quote
Hi, Anyone knows why only the first ruleset apply? the second and all following rules didn't work as expected. Thanks in advance.

Startup:
ifconfig vlan2:1 130.180.X.X netmask 255.255.255.248 broadcast 130.180.X.X
ifconfig vlan2:2 130.180.X.X netmask 255.255.255.248 broadcast 130.180.X.X
ifconfig vlan2:3 130.180.X.X netmask 255.255.255.248 broadcast 130.180.X.X
ifconfig vlan2:4 130.180.X.X netmask 255.255.255.248 broadcast 130.180.X.X

Firewall:
# WAN .6X -> LAN .2 Diskstation
iptables -t nat -I PREROUTING -d 130.180.X.X -j DNAT --to-destination 192.168.2.2
iptables -I FORWARD -d 192.168.2.2 -p tcp --dport 12462 -j ACCEPT
iptables -I FORWARD -d 192.168.2.2 -p tcp --dport 51413 -j ACCEPT
iptables -I FORWARD -d 192.168.2.2 -p tcp --dport 1723 -j ACCEPT
iptables -I FORWARD -d 192.168.2.2 -p tcp --dport 12465 -j ACCEPT

# WAN .6X -> LAN .14
iptables -t nat -I PREROUTING -d 130.180.X.X -j DNAT --to 192.168.2.114
iptables -I FORWARD -d 192.168.2.114 -p tcp --dport 443 -j ACCEPT
iptables -I FORWARD -d 192.168.2.114 -p tcp --dport 8443 -j ACCEPT

# WAN .6X -> LAN .12
iptables -t nat -I PREROUTING -d 130.180.X.X -j DNAT --to-destination 192.168.2.112
iptables -I FORWARD -d 192.168.2.112 -p tcp --dport 443 -j ACCEPT
SabGoblin
DD-WRT Novice


Joined: 17 Apr 2018
Posts: 1

PostPosted: Tue Apr 17, 2018 15:24    Post subject: router wrt54g v 3.0 Reply with quote
if have put this rule on my startup and firewall command

WANIF=`get_wanface`
ifconfig $WANIF:1 69.196.22.3 netmask 255.255.255.192 broadcast 69.196.22.63

# WAN .3 -> LAN .44
iptables -t nat -I POSTROUTING -s 192.168.15.44 -j SNAT --to 69.196.22.3
iptables -t nat -I PREROUTING -d 69.196.22.3 -j DNAT --to 192.168.15.44
iptables -I FORWARD -d 192.168.15.44 -j ACCEPT

when i'm connected at internet via my wrt54g router when i try to connect on 69.196.22.3 it's work good but when i'm the outside of this network exemple at my home i try to connect to 69.196.22.3 it's not working do you have idea ??
Goto page Previous  1, 2, 3 Display posts from previous:    Page 3 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum