Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ifconfig ?

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hello,
I am a newbi in this so please bear with me. I have taken over a FreeBSD box that basically acts as a router/NAT. With the command ifconfig I can see the 'inet' ip address. My question(s) are this. How do I change the inet ip address? Where do I change this? If someone could point me in the right direction I would be most happy. I am willing to 'dig into it and learn', but I need to know where to start. ANy help would be appreciated.
 
what ver of FreeBSD do you have?
in newer, you can change main IP in the file
/etc/rc.conf
in there is the default router ip and hostname as well.

if you need more help with ifconfig ( and rest of the freebsd :) type
#man ifconfig
or visit also, if you can be more specific, you can ask question here and we'll try to help you.
good luck.
 
I am quite sure its one of the lastest (last 6 months), the exact version I will have to take a look. I take it I just edit the rc.conf file with vi or something? That's pretty simple. Where do I set the 'internal' range of ip addreses (f.ex. 192.168.0.1-192.168.0.10)? Also in the rc.conf? As you can guess this box has two NICs. Thanks for your help :)
 
nope, you would like to use /etc/rc.local for that ( at least that's the way how i organize my servers).
in there type:
/sbin/ifconfig xl1 inet 192.168.0.1 netmask 255.255.255.0
/sbin/ifconfig xl1 inet 192.168.0.2 netmask 255.255.255.0 alias
...
why like this? it's easyer to maintain server w/o messing up too much ( again, my opinion)
hth

 
axvpaa: thanks. I edited the rc.conf (just with vi and overwrote the old with the new ip address) and it works. How easy things are when you know where to look. Just one question (if I may): can I type in the (I have a cable modem) 'name' address in rc.conf? For example, instead of typing xxx.xxx.xxx.xx could I use me.local.province.country.company.com ? I am not sure wheher the DNS would figure this out, so I gues the question is does DNS start first or after? Or am I making myself clear? It is my understanding that most cable modem providers use dynamic ip addresses, which is why I thought that if I typed in the 'complete' address it would make resolving it easier...
 
axvpaa : sorry for being such an inconsiderate fool, I promised to check what version, and as far as I can tell I am running FreeBSD ver. 4.3. IF it makes a difference...
 
howdy,
no, you can't type your 'name address' because your interface needs a number. if you have a static ip, it's easy. just put your ip in rc.conf, netmask and default gw.
if not ( DHCP case), let me know so i can see how to help you with that.
btw, first you have ip assigned to interface and then later in the boot process you have dns started. ( if you do DNS for yourself, if not ---> check /etc/resolv.conf)
in any event, have fun and let me know
hth
p.s. 4.3 is fearly new. 4.4 is newest ( unless you wann go with current 5.0)

 
I used the static ip and entered it in rc.conf, and as I said, everything works - thanks. Now at least I know how to do that. Thanks for your help, if anything else crops up, and something probably will, I will get back to this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top