Reply to comment

Files related to network configuration in OpenBSD

Setting up a network interface, it's routes, resolving and so on, can be complicated when you don't know your way around in OpenBSD. You will see it's not difficult at all to setup or change the network configuration of a box when you know about the existence of these files and man-pages.

  • /etc/hostname.if - This is where you set a IP address, netmask and broadcast address of the interface. Replace "if" with the name of the network interface, like sk0, sis1, etc. You are able to determine the available network interfaces using the command ifconfig(8). Checkout the man-page of hostname.if(5) for more details. One example of what you could find in a hostname.if file: inet 192.168.1.1 255.255.255.0 192.168.1.255 or just dhcp if you would want to use DHCP. When you are using DHPC, you don't need to read the rest, you are done!
  • /etc/mygate - The default route to the internet. One IP address (can be IPv4 or IPv6) will let the TCP/IP stack know where to send non-local traffic to.
  • /etc/myname - The hostname of the system, in the longest syntax, including domain and toplevel domain, like host1.example.com. Normally you will find this name and it's IP in /etc/hosts. (see below)
  • /etc/hosts - The manual resolver. Don't use this too much, better rely on DNS to resolve hostname to IP addressed and the other way around. But; it's common to at least put the hostname and localhost in /etc/hosts. One example line would be: 192.168.1.1 host1.example.com host1
  • /etc/resolv.conf - The system needs to know how can resolve names to IP addresses, this is the file you need! It contains a few items, like domain example.com. This tells the resolver that all hostnames you are searching for without a top level domain, are relative to example.com. If you would like to add more "local domains", you can use the search otherexample.com thirdexample.com variable. Do take care not to add too many domains; it will be confusing to what host you are connecting. The most important is to tell the resolver that there are nameservers in use. Each nameserver that it could use has it's own line, like this: nameserver 192.168.1.2.

Well, you should be able to configure the network cards on your OpenBSD machine now.

Sometimes you will find additional configuration in /etc/rc.local, like an extra route to you VPN network. OpenBSD does not facilitate for these extra parameters, so adding them to /etc/rc.local is a good, but not very generic option.

Reply

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Insert Google Map macro.

More information about formatting options

CAPTCHA
Deze vraag wordt gebruikt om te testen of u een menselijke bezoeker bent teneinde spam-inzendingen te vermijden.
1 + 0 =
Los deze eenvoudige rekenoefening op en voer het resultaat in. Bijvoorbeeld: voor 1+3, voer 4 in.
By submitting this form, you accept the Mollom privacy policy.