fryol
FBSD Install Notes: configuring networking, sshd

  • generally the network should be configured automatically – and should be easy to figure out by doing ifconfig
  • during the setup, sysinstall should have already asked if you want DHCP to be set up – but if you missed it, here’s more…
  • ifconfig sure gave me vr0 as up and running, but didn’t have any IP address configured on it
  • ..so, let’s run /sbin/dhclient vr0 – being sure that we replace vr0 with whatever is the network device name outputted by:
    • ifconfig|head -1|cut -f1 -d:
  • ..that should make sure that we have an IP address – and my pings to yahoo.com returned replies
  • to make sure DHCP runs at startup every time and network gets configured, run sudo sysinstall …

    • and select Configure > Networking > Interfaces and say yes when asked for  DHCP configuration
    • enter the value in Hostname field; and if you don’t want any DHCP configuration (you probably already said “No”) enter a fixed IP in the IPv4 Address
  • we also need sshd to run everytime at startup: and you again need to configure that in sysinstall > Configure > Networking > sshd
  • all of this is actually adding lines to /etc/rc.conf (like sshd_enable=”YES” / ifconfig_vr0=”inet abc.def.xyz.zyx  netmask 255.255.255.0″)

In case you want a static IP configuration, you are probably not going to use the DHCP options above. In that case, I added the following lines to my /etc/rc.conf:

  • ifconfig_vr0="192.168.xxx.xxx"
    defaultrouter="192.168.xxx.xxx"

..where the defaultrouter IP is the address that I can see next to “default” when I do a `netstat -r` from any other computer on my network. Also, to make sure DNS resolves (and since there’s no auto configuration happening), I make sure to add a primary/secondary DNS IP into /etc/resolv.conf:

  • nameserver  208.67.222.222  # opendns IP