IFCONFIG

  • Prime
  • Professor
  • Professor
  • User avatar
  • Joined: Dec 05, 2005
  • Posts: 935
  • Loc: Liverpool
  • Status: Offline

Post December 19th, 2005, 8:46 am

I need to assign a new IP address, subnet mask and gateway address to a FreeBSD server so that I can back it up before I trash it :?

I've been reading the IFCONFIG command but am twice as confused as when I started :cry:

Can anybody please post a simple example else point me to a good tutorial :?:

Many thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 19th, 2005, 8:46 am

  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Joined: Oct 30, 2004
  • Posts: 2521
  • Loc: /usr/src/MI
  • Status: Offline

Post December 19th, 2005, 11:19 am

http://www.linuxforum.com/shell/ifconfig/55-18.php
  • Prime
  • Professor
  • Professor
  • User avatar
  • Joined: Dec 05, 2005
  • Posts: 935
  • Loc: Liverpool
  • Status: Offline

Post December 20th, 2005, 3:04 am

Thankyou :D

The small example at the bottom of the page was all i (nearly) needed :D

I entered ...

ifconfig bge0 xx.xx.xxx.xxx netmask 255.255.255.XXX

I've assigned an IP address with a subnet successfully and the machine can ping itself however, when it try to ping a.n.other box it tells me there is "no route defined". I assume it's because I haven't defined our gateway address ...
so ... I did some further digging and came across the "route" command and tried the following syntax:

route add -net XXX.XXX.XX.XX netmask 255.255.255.248 dev bge0

but it errors firstly with "bad netmask", so I removed the netmask bit. Then it errored with something about "bad dev" ... until eventually I was left with

route add -net xxx.xx.xx.xx beg0

... but that didn't work either ... :? :cry:

Any further guidence would be much appreciated.



Cheers, Prime :shock: :D
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post December 20th, 2005, 7:17 am

I have no idea what your network topology looks like, but if you are just plugging your machine into a switch or hub a gateway would be sufficient -- unless you have multiple routes (box is router or FW) you don't need to add them.

If you have a class C (non-internet addressable, often beginning with 192.168) your netmask should be a simple 255.255.255.0.

If you want the IP to survive the reboot, you will need to add it to the /etc/rc.conf file.
Code: [ Select ]
ifconfig_dc1="inet 192.168.x.x netmask 255.255.255.0"


An easier way would be to go ;
Code: [ Select ]
/stand/sysinstall

Slide down to config options, then networking. You get the option of installing your gateway IP, etc. and this interface will write to the rc.conf file for you.

Cheers.
"It's always a long day, 86,400 won't fit into a short."
  • Prime
  • Professor
  • Professor
  • User avatar
  • Joined: Dec 05, 2005
  • Posts: 935
  • Loc: Liverpool
  • Status: Offline

Post December 20th, 2005, 10:27 am

Thankyou!

/stand/sysintall - i've been peeing around with the command line all day :evil: :evil: completely forgot about that app :lol:

Cheers, Prime ... :shock: :D
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post December 20th, 2005, 6:57 pm

No worries.
"It's always a long day, 86,400 won't fit into a short."

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 74 guests
  • 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 post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.