What's new

Static ip setup for a device

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

jjulez

Regular Contributor
Got some ip's from my isp. how do i set it up. Running asus rt-ac66u merlin 380.63.2.Thanks
 
Anyone know how, trying to give a device static ip my isp gave me.
Friend told me it must be done in the router and something about port fowarding
also been part of it
 
Anyone know how, trying to give a device static ip my isp gave me.
Friend told me it must be done in the router and something about port fowarding
also been part of it

Are you talking about ip your ISP give for WAN port? Or talking about ip handled by DHCP in your router for connected device? In this case your friend is right. If you mess with WAN ip, you could lose Internet connection.
 
Way over my head in this.The static ip is for storage device just don't know how it's done.
I can give it an ip from the router that all start with 192..but when i try the isp ones
says not valid ip.something i must be doing wrong
 
If I understand correctly you've asked your ISP for a static IP address so that you can remotely access your storage device behind your router. You probably didn't need the static IP address (Could have just used the DDNS settings) but seeing as you have one you would insert it via WAN->Internet Connection tab.

If they provided you with the IP, Subnet Mask, Default Gateway and Subnet mask and DNS server values you'll be able to enter then into the appropriate fields under the WAN IP Settings, these fields become accessible when you change the WAN connection type from Automatic IP to Static IP.

If you didn't get the additional information you'll be able to get the current ones assigned by clicking on the Globe to the left of the Internet Status on the Network Map page. Warning: Sometimes the ISP will provide a Static IP address that has a different Gateway/Subnet mask from what they give out via DHCP so use with caution.

Once you've entered in the values click the Apply button. If things are working correctly you should still have Internet access and can validate that your router is using the static IP address by visiting: https://ipleak.net Your IP address should appear there.

Not sure what you're want to access on your storage device but you would setup the port forwarding values under the WAN->Virtual Server/Port Forwarding tab.

In case you lose your Internet connection you may need to reboot your modem as well. If that doesn't work you can always set your WAN back to get an Automatic IP address.
 
Way over my head in this.The static ip is for storage device just don't know how it's done.
I can give it an ip from the router that all start with 192..but when i try the isp ones
says not valid ip.something i must be doing wrong

To expose LAN devices using a public WAN I/P then you will need to add statements to nat-start script

e.g.

Code:
#!/bin/sh

WAN_IF=$(nvram get wan0_ifname)

STATIC_NETMASK=255.255.255.248                  # <<- Change this?...Provided by ISP e.g. covers 8 I/P addresses

VIRTUAL_IF=0
STATIC_WAN_IP=WAN.xxx.xxx.XXX                   # <<- Change this....First Static public I/P provided by ISP
LAN_IP_FOR_STATIC_WAN_IP=192.zzz.zzz.ZZZ        # <<- Change this....First LAN device I/P to be referenced by First public Static I/P

# Map the public WAN I/P to private LAN device
ifconfig $WAN_IF:$VIRTUAL_IF $STATIC_WAN_IP netmask $STATIC_NETMASK up
iptables -t nat -A PREROUTING  -i $WAN_IF -d $STATIC_WAN_IP -j DNAT --to-destination $LAN_IP_FOR_STATIC_WAN_IP
iptables -t nat -I POSTROUTING -s $LAN_IP_FOR_STATIC_WAN_IP -j SNAT --to $STATIC_WAN_IP



# Repeat for next static WAN/LAN device......

VIRTUAL_IF=$(($VIRTUAL_IF + 1))
STATIC_WAN_IP=xxx.xxx.xxx.XXX2                  # <<- Change this....Second Static public I/P provided by ISP
LAN_IP_FOR_STATIC_WAN_IP=192.xxx.xxx.ZZZ2       # <<- Change this....Second LAN device I/P to be referenced by Second public Static I/P


ifconfig $WAN_IF:$VIRTUAL_IF $STATIC_WAN_IP netmask $STATIC_NETMASK up
iptables -t nat -A PREROUTING  -i $WAN_IF -d $STATIC_WAN_IP -j DNAT --to-destination $LAN_IP_FOR_STATIC_WAN_IP
iptables -t nat -I POSTROUTING -s $LAN_IP_FOR_STATIC_WAN_IP -j SNAT --to $STATIC_WAN_IP

NOTE: You could of course convert the statements into a function! ;)

Then you should add the appropriate Port forwarding rules via the GUI as described by @Zirescu
 
Last edited:
Thanks for all the input,as i said i'm way in over my head on this will have
to get someone who know this stuff in & out
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top