OpenWrt Forum Archive

Topic: [SOLVED] Configure IP Address on 2 Interfaces?

The content of this topic has been archived on 1 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all, if you look at the network configuration below, I’ve configured interface eth0 & eth1 with static ip address.
But when I do ifconfig, eth0 & eth1 are empty.
Previous network configuration was assigned to interface br-lan & br-lan2 instead of eth0 & eth1 respectively.
Please advise. Thanks

root@OpenWrt:~# cat /etc/config/network
    # Copyright (C) 2006 OpenWrt.org

    config interface loopback
    option ifname   lo
    option proto    static
    option ipaddr   127.0.0.1
    option netmask  255.0.0.0

    config interface lan
    option ifname   eth0
    option type     bridge
    option proto    static
    option ipaddr   192.168.10.11
    option netmask  255.255.255.0

    config interface lan2
    option ifname   eth1
    option type     bridge
    option proto    static
    option ipaddr   10.0.0.1
    option netmask  255.255.255.0

    root@OpenWrt:~#

root@OpenWrt:~# ifconfig
    br-lan    Link encap:Ethernet  HWaddr 08:00:27:27:6C:B4
    inet addr:192.168.10.11  Bcast:192.168.10.255  Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    RX packets:65 errors:0 dropped:0 overruns:0 frame:0
    TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:6088 (5.9 KiB)  TX bytes:4380 (4.2 KiB)

    br-lan2   Link encap:Ethernet  HWaddr 08:00:27:38:B5:ED
    inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    eth0      Link encap:Ethernet  HWaddr 08:00:27:27:6C:B4
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    RX packets:3757 errors:0 dropped:0 overruns:0 frame:0
    TX packets:673 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:438088 (427.8 KiB)  TX bytes:85642 (83.6 KiB)

    eth1      Link encap:Ethernet  HWaddr 08:00:27:38:B5:ED
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B)  TX bytes:368 (368.0 B)

    lo        Link encap:Local Loopback
    inet addr:127.0.0.1  Mask:255.0.0.0
    UP LOOPBACK RUNNING  MTU:16436  Metric:1
    RX packets:71625 errors:0 dropped:0 overruns:0 frame:0
    TX packets:71625 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4715578 (4.4 MiB)  TX bytes:4715578 (4.4 MiB)

    root@OpenWrt:~

(Last edited by FirewallEngineer on 6 Sep 2013, 12:23)

Remove "option type bridge".

jow wrote:

Remove "option type bridge".

Perfect!!! Million thanks to you smile

root@OpenWrt:~# vi /etc/config/network
# Copyright (C) 2006 OpenWrt.org

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
#       option type     bridge
        option proto    static
        option ipaddr   192.168.10.11
        option netmask  255.255.255.0

config interface lan2
        option ifname   eth1
#       option type     bridge
        option proto    static
        option ipaddr   10.0.0.1
        option netmask  255.255.255.0

~
root@OpenWrt:~#
root@OpenWrt:~# /etc/init.d/network restart
root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:27:6C:B4
          inet addr:192.168.10.11  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:252 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:28245 (27.5 KiB)  TX bytes:18830 (18.3 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:38:B5:ED
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:180 (180.0 B)  TX bytes:138 (138.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3299 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3299 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:172260 (168.2 KiB)  TX bytes:172260 (168.2 KiB)

root@OpenWrt:~#

The discussion might have continued from here.