Multiple public ipadresses

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
DD-WRT Novice

Joined: 02 Feb 2007
Posts: 2

PostPosted: Fri Feb 02, 2007 19:55    Post subject: Multiple public ipadresses Reply with quote

I’m running a linksys wrt54gl with dd-wrt v23 sp2 and I have a question.
I have 5 dynamic ipadresses from my isp and I would like the router to request at least two of them.
No1 for normal NATing.
No2 for DMZ or full port forwarding to a given device or port on the router.

What I want to achieve is to have multiple PC’s behind the router sharing an IP but also having an additional node in the network that is bound to one ipaddress.

I would really appreciate any hints.

Thanks in advance!
DD-WRT Novice

Joined: 05 Feb 2007
Posts: 1

PostPosted: Mon Feb 05, 2007 2:41    Post subject: Multiple public ipaddresses Reply with quote
I'm looking at how to do this also. Did you find an answer?

markh aka oneobserver
DD-WRT Novice

Joined: 02 Feb 2007
Posts: 2

PostPosted: Mon Feb 05, 2007 10:20    Post subject: Reply with quote

None seems to have a clue!

Joined: 16 Jun 2006
Posts: 133
Location: Kolding, Denmark

PostPosted: Tue Feb 06, 2007 8:41    Post subject: Reply with quote
Just configure your router normally and then all clients will be connected and NAT'ing, then add the following to a startup script

/usr/sbin/ip addr add dev vlan1
/usr/sbin/iptables -I FORWARD -d -j ACCEPT
/usr/sbin/iptables -t nat -I PREROUTING 1 -p all -d -j DNAT --to
/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s -j SNAT --to is the external IP is the internal IP that you want to respond to

I'm using something like this of course it's modified with other rules so it's not a DMZ. Security is up to you

BTW: This information or similar discussion has been posted by others before in this forum, search and you'll find.
DD-WRT Novice

Joined: 08 Jun 2006
Posts: 27
Location: Diemen (NL)

PostPosted: Wed Feb 14, 2007 16:29    Post subject: Reply with quote
The above script will only work if you have static IP-addresses from your ISP.
Don't know how to do this for dynamically obtained IP-addresses.
DD-WRT Novice

Joined: 17 Feb 2007
Posts: 27
Location: Sortland - Norway

PostPosted: Wed Feb 21, 2007 23:05    Post subject: set up switch-port 3 and 4 to wan. Reply with quote
if your isp can give you severals public ip`s and you want a second router on the inner side of the first but at the same time have public address you can run this and save it in start up.
in comand window on your router:

nvram set vlan0ports="1 2 5*"
nvram set vlan1ports="0 3 4 5"

run this and save it on "start up"

you wil now have switc port 3 and 4 direct straight throu. and you wil get two wan ip adresses on the back side of the router on port 3 and 4.

even if they are dynamic or static.
i running this myself and it works wery good.

also look in wiki`s "Howe to". link wan to switch.

Per Tharaldsen Sortland Norway.
Cellphone: + 47 47248733
Several Buffalo whr-g54s
ddwrt v23 vpn sp 2
also asus 520 with dd-wrt
DD-WRT Novice

Joined: 04 Mar 2007
Posts: 9

PostPosted: Wed Mar 07, 2007 18:29    Post subject: Reply with quote
but if my ISP gives me 5 static IPs, Can I just use iptables to accomplish static routing/port forwarding without multiple routers? Can I use this with the web-client? like if has an IP, IP1 and has another IP, IP2, and assume IP1 and IP2 are different. Can I use the webclient to route port x using the name machine1 on the internal network?

I saw the entries in iptables that were created using the webclient, and it seemed to do something like this. like if I set my domain in DNSmasq to, then the iptables entries used the "name" field of the port forwarding. like I could type machine1 as the "name" for port forwarding, and then would it forward to this port when the request is for the IP that is assigned to machine1? It seems like this is how the forwarding is set up by default, especially because dd-wrt allows you to set up port forwarding with several entries for the same port and does not give an error.

I want to keep this as simple as possible, and I especially don't want to have to use more than one router (if I used multiple ones, I guess I could just hook the DSL modem up to a 6 port switch, with each router assigned to a specific IP and have its WAN interface connected to the "WAN" switch.)

Speaking of switches, not to go off topic, but does anyone know if there is any third-party "dd-wrt-like" firmware for managed switches? I might be buying some netgear or linksys gigabt managed switches, and after using dd-wrt, I dread having to use stock firmware again.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT


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