The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 19, 2019, 02:29:31 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: How to? Static Ip Freebsd dev server  (Read 4058 times)
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« on: January 03, 2008, 12:14:48 AM »

You guys will probably be able to help me with this.

I have a dev server here that I use for production work.

It is connected directly to my router and Im accessing from my home network with Samba.

Everytime I do a server reboot however, the IP changes, and I have to manually go in and alter all the network settings again, to be able to get it all operating again properly.

My router is setup to distribute local ips... (re.. 192.168.0.*) to the boxes on the network.

How do ensure that the freebsd machine, always connects back to the network using the same IP? (192.168.0.10)

Probably an easy one, but I cant seem to find anything on it. (well nothing that gets through my thick skull anyway)
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: January 03, 2008, 04:02:04 PM »

The machine sounds like it's set for DHCP rather than a static address, that's all.

I don't know enough FreeBSD to tell you how to do it, but if you can get to the GUI there will certainly be a network admin cpanel that will allow you to specify how you want the NIC to behave.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #2 on: January 04, 2008, 07:53:26 AM »

GUI? whats that? never could get X running, never could be bothered really trying. lol

Anywho, managed to get it.

It was set to DHCP.

So for anyone who comes across this..

In my /etc/rc.conf

i replaced
ifconfig_em0="DHCP"
with
ifconfig_em0="192.168.0.50 netmask 255.255.255.0"

(em0 being my network adapter of course)

Rebooted the box, and all is well. Now I just have to reset everything to run from 192.168.0.50.
Logged
ratthing
Journeyman
***
Offline Offline

Posts: 75


View Profile
« Reply #3 on: January 05, 2008, 04:15:35 PM »

You probably also want to make sure your router won't hand out that IP address to some other machine on your network, too.  A well-behaved DHCP server *shouldn't*, but consumer home routers aren't well-known for being well-behaved. :-/

You should also put the entry into your /etc/hosts file, so your local applications can do reverse name lookups if they happen to use the 192.x IP rather than the loopback interface (127.0.0.1).

If you're feeling ambitious, you could do full-blown "fake" DNS for your local network http://www.langfeldt.net/DNS-HOWTO/BIND-8/DNS-HOWTO-5.html.

=RT=
Logged
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #4 on: January 05, 2008, 07:18:03 PM »

Thanks ratthing.

Already have altered the hosts file.

Code:
::1                         localhost localhost.server
127.0.0.1                localhost localhost.server
192.168.0.50           localhost localhost.server
192.168.0.50           server.localhost

Not sure why it had a double entry for the *.50 ip but meh.. it works..

Bookmarked the fake dns stuff for future reference, took a quick look at it and recognize the arpa settings as Ive been playing with them of late on our work servers. (this shit just fries my brain though, I guess it'll sink in sooner or later)
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: January 06, 2008, 12:12:15 AM »

Not sure why it had a double entry for the *.50 ip but meh.. it works..

I often have multiple names for a single address... that's all that's happening there.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
ratthing
Journeyman
***
Offline Offline

Posts: 75


View Profile
« Reply #6 on: January 09, 2008, 10:46:44 AM »

Bookmarked the fake dns stuff for future reference, took a quick look at it and recognize the arpa settings as Ive been playing with them of late on our work servers. (this shit just fries my brain though, I guess it'll sink in sooner or later)

You're welcome.  DNS is not really that complicated, just another form of pointers, so you should be able to wrap your head around it if you get the latter.

I don't really need fake DNS but I may go ahead and implement it as my ISP's DNS servers suck rocks so bad I've been considering implementing a caching name server anyway.  If I do, I'll document it step-by-step, otherwise I won't remember wtf I did later.  :huh:  I'll post when I do.

=RT=
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!