Linux-Noob Forums
static inet address ? how do i?! - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: Network Problems (https://www.linux-noob.com/forums/forum-58.html)
+--- Thread: static inet address ? how do i?! (/thread-2468.html)



static inet address ? how do i?! - tek-69 - 2005-08-24


ok first the sob story:

Boo hooo! I live on the worst block in the U.S. ever. power is always goin out on me at least once a month, so much for taking the uptime crown....

 

ok now the issue:

Everytime the power goes out my box's inet addr changes, sometimes it's 192.168.1.101 sometimes it's 102 sometimes 103. usually 103. I have a linksys router that sits between 3 computers and the cable modem, and it forwards the nessesary ports for me, but when the inet addr changes i have to go in and change the addy for every port on the router. This is a pain in the neck. Is there any way i can have one inet address that never changes, and if so how do i do it? Is it a router thing or something i should set up on the box itself? Any help would be greatly appreciated. :)




static inet address ? how do i?! - KobrAs - 2005-08-24


Hello,

 

You currently use dhcp enabled network, you can setup a static ip address from class 192.168.0.0/24, that means 253 usable ips except gateway, network, broadcast. You will need to set manualy the ip,netmask,gateway and the dns servers (more than one).

if you use linux, you could do that easy, especialy redhat/fedora typing 'netconfig' command from a root terminal (then configure it for your needs). If you use other linux you could do :

ifconfig eth0 192.168.0.100 netmask 255.255.255.0

route add default gw 192.168.0.nr (where nr is the last digit of the gateway server)

echo "nameserver ns.provider.com" > /etc/resolve.conf

echo "nameserver ns2.provider.com" >> /etc/resolve.conf

 

I hope that helps you




static inet address ? how do i?! - anyweb - 2005-08-24


thanks Kobras !

 

moved topic to networking.

 

cheers

 

anyweb




static inet address ? how do i?! - znx - 2005-08-30


Quote:ok first the sob story:Boo hooo! I live on the worst block in the U.S. ever. power is always goin out on me at least once a month, so much for taking the uptime crown....

 

ok now the issue:

Everytime the power goes out my box's inet addr changes, sometimes it's 192.168.1.101 sometimes it's 102 sometimes 103. usually 103. I have a linksys router that sits between 3 computers and the cable modem, and it forwards the nessesary ports for me, but when the inet addr changes i have to go in and change the addy for every port on the router. This is a pain in the neck. Is there any way i can have one inet address that never changes, and if so how do i do it? Is it a router thing or something i should set up on the box itself? Any help would be greatly appreciated.  :)



 

Ouch, my router allows me to bind IPs to MAC addresses. I can also specify hostname to IPs.

 

If might be possible that specifying certain options with your DHCP client might prompt the router to hand out the same IP each time.