LINUX INTERACE

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

Post 3+ Months Ago

Hi Guys,

I'm dipping my toes in Linux and have just installed FreeBSD (4.6) on a rack mounted server and need to assign an IP address. However, when I "ifconfig" there doesn't appear to be any interfaces installed. I can't "ifconfig eth0".

I'm a developer fishing in the wrong pond - any idiot friendly advice would be appreciated.

Cheers, Prime
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

First off, FreeBSD is not Linux - it's BSD. Calling FreeBSD Linux is like calling AIX FreeBSD - though it's better than calling Windows an operating system.

Now that the symantics are out of the way:
run the following:
Code: [ Select ]
#dmesg | grep Ethernet

it should return something like:
Code: [ Select ]
xl0: Ethernet address: 00:10:5a:e4:b1:04

The "xl0" at the beginning of that line is the name of your device. This name is different depending on the driver for your NIC. For the rest of these examples, I'll use xl0, since I've already started with that.
Assuming you want to call you computer "this_computer", that your gateway has an ip address of 192.168.0.1 and that you want to assign 192.168.0.5 to "this_computer" and that your netmask is 255.255.255.0, open your /etc/rc.conf and add the following (or make sure they exist):
Code: [ Select ]
defaultrouter="192.168.0.1"
hostname="this_computer.your_domain.tld"
ifconfig_xl0="inet 192.168.0.5 netmask 255.255.255.0"
  1. defaultrouter="192.168.0.1"
  2. hostname="this_computer.your_domain.tld"
  3. ifconfig_xl0="inet 192.168.0.5 netmask 255.255.255.0"

Note how I put "xl0" on ifconfig rather than eth0. Change this to match what dmesg put out above. If you issue ifconfig against the NIC, you'd do ifconfig xl0 in this case - not ifconfig eth0.

This will handle setting your ip address when you reboot - but I'm sure you don't want to reboot just to be able to get to the rest of your network (it's not Windows, after all), so issue the following:
Code: [ Select ]
#/etc/netstart

This will cause the network to restart and rc.conf to be reread - you should be all set.

If dmesg didn't return anything above, your NIC isn't installed and you'll have to deal with that before you can do anything else.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

That was a lucid and intelligent post this123. I could not have said it better myself. Well done.
  • Prime
  • Professor
  • Professor
  • User avatar
  • Posts: 935
  • Loc: Liverpool

Post 3+ Months Ago

phew - thanks for the effort, much appreciated :shock: :D

I shall never confuse BSD with linux again :lol:

Post Information

  • Total Posts in this topic: 4 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
 
 

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