Selasa, 18 Maret 2008

Mikrotik : Working with Interfaces

Before configuring the IP addresses and routes please check the '/interface' menu to see the list of available interfaces. If you have PCI Ethernet cards installed in the router, it is most likely that the device drivers have been loaded for them automatically, and the relevant interfaces appear on the '/interface print' list, for example:

[MikroTik] interface> print                                                   
Flags: X - disabled, D - dynamic
# NAME MTU TYPE
0 X ether1 1500 ether
[MikroTik] interface>

The device drivers for NE2000 compatible ISA cards need to be loaded using the 'add' command under the /drivers menu. For example, to load the driver for a card with IO address 0x280 and IRQ 5, it is enough to issue the command:

[MikroTik] driver> add name=ne2k-isa io=0x280                                      
[MikroTik] driver> print
Flags: I - invalid, D - dynamic
# DRIVER IRQ IO MEMORY ISDN-PROTOCOL
0 D PCI NE2000
1 ISA NE2000 280
[MikroTik] driver>

The interfaces need to be enabled, if you want to use them for communications. Use the '/interface enable name' command to enable the interface with a given name, for example:

[MikroTik] interface> print                                                   
Flags: X - disabled, D - dynamic
# NAME MTU TYPE
0 X ether1 1500 ether
1 X ether2 1500 ether
[MikroTik] interface> enable 0
[MikroTik] interface> enable ether2
[MikroTik] interface> print
Flags: X - disabled, D - dynamic
# NAME MTU TYPE
0 ether1 1500 ether
1 ether2 1500 ether
[MikroTik] interface>

You can use the number or the name of the interface in the 'enable' command.

The interface name can be changed to a more descriptive one by using the '/interface set' command:

[MikroTik] interface> set 0 name=Public                                           
[MikroTik] interface> set 1 name=Local
[MikroTik] interface> print
Flags: X - disabled, D - dynamic
# NAME MTU TYPE
0 Public 1500 ether
1 Local 1500 ether
[MikroTik] interface>

Use of the 'setup' Command

The initial setup of the router can be done by using the '/setup' command which enables an interface, assigns an address/netmask to it, and configures the default route. If you do not use the setup command, or need to modify/add the settings for addresses and routes, please follow the steps described below.