IFCONFIG

  • Prime
  • Professor
  • Professor
  • User avatar
  • Posts: 935
  • Loc: Liverpool

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

http://www.linuxforum.com/shell/ifconfig/55-18.php
  • Prime
  • Professor
  • Professor
  • User avatar
  • Posts: 935
  • Loc: Liverpool

Post 3+ Months Ago

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
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

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.
  • Prime
  • Professor
  • Professor
  • User avatar
  • Posts: 935
  • Loc: Liverpool

Post 3+ Months Ago

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
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

No worries.

Post Information

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

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.