This document is based on http://downloads.openwrt.org/kamikaze/docs/openwrt.html#x1-80001.2.1

Network Configuration

The network configuration in CrisOs is stored in /etc/config/network and is divided into interface configurations. Each interface configuration either refers directly to an ethernet/wifi interface (eth0, wlan0, ..) or to a bridge containing multiple interfaces. It looks like this:

  config interface     "lan"
      option ifname    "eth0"
      option proto     "static"
      option ipaddr    "192.168.1.1"
      option netmask   "255.255.255.0"
      option gateway   "192.168.1.254"
      option dns       "192.168.1.254"

ifname specifies the Linux interface name. If you want to use bridging on one or more interfaces, set ifname to a list of interfaces and add:

    option type     "bridge"

This sets up a simple static configuration for eth0. proto specifies the protocol used for the interface. The default image provides ’none’, ’static’ and ’dhcp’ the default. Others,such as pppoe can be added by installing additional packages.

When using the ’static’ method like in the example, the options ipaddr and netmask are mandatory, while gateway and dns are optional. You can specify more than one DNS server, separated with spaces.

DHCP currently only accepts ipaddr (IP address to request from the server) and hostname (client hostname identify as) - both are optional.

PPP based protocols 1)(pppoe, pptp, …) accept these options:

  • username The PPP username (usually with PAP authentication)
  • password The PPP password
  • keepalive Ping the PPP server (using LCP). The value of this option specifies the maximum number of failed pings before reconnecting. The ping interval defaults to 5, but can be changed by appending ”,<interval>” to the keepalive value
  • demand Use Dial on Demand (value specifies the maximum idle time.
  • server: (pptp) The remote pptp server IP

For all protocol types, you can also specify the MTU by using the mtu option.

Setting up static routes

You can set up static routes for a specific interface that will be brought up after the interface is configured.

Simply add a config section like this:

  config route foo
   option interface lan
   option target 1.1.1.0
   option netmask 255.255.255.0
   option gateway 192.168.1.1

The name for the route section is optional, the interface, target and gateway options are mandatory. Leaving out the netmask option will turn the route into a host route.

1) NOTE not installed by default on CrisOs Images
documentation/config/network.txt · Last modified: 2010/02/06 11:02 (external edit)
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0