Home Forums Getting Started (Ubuntu) Separate IPs For Each Lan

This topic contains 9 replies, has 4 voices, and was last updated by  OV 2 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1280

    OV
    Participant

    Hello, and thank you in advance for any all assistance you may lend. I’ve gotten as far as installing Ubuntu and getting the network up and running (thanks to all you who have posted out here). I am wishing to have different IP addresses for each of the LAN ports. Right now, I can get two IP addresses, but they’re both responding on the same physical RJ-45 connection. Meaning, if I unplug my cable, and plug it into the other LAN port, neither of the IP addresses respond to pings. Below is my /etc/network/interfaces file:

    
    # interfaces(5) file used by ifup(8) and ifdown(8)
    # Include files from /etc/network/interfaces.d:
    source-directory /etc/network/interfaces.d
    
    auto eth0
    iface eth0 inet manual
    
    auto lo
    iface lo inet loopback
    
    #auto wan
    #iface wan inet dhcp
    #pre-up /sbin/ifconfig eth0 up
    
    auto lan1
    iface lan1 inet static
    address 192.168.0.20
    netmask 255.255.0.0
    network 192.168.0.0
    broadcast 192.168.255.255
    gateway 192.168.0.1
    dns-nameservers 8.8.8.8 8.8.4.4
    #pre-up /sbin/ifconfig lan1 up
    pre-up /sbin/ifconfig eth0 up
    
    auto lan0
    iface lan0 inet static
    address 192.168.0.21
    netmask 255.255.0.0
    network 192.168.0.0
    #broadcast 192.168.255.255
    gateway 192.168.0.1
    dns-nameservers 8.8.8.8 8.8.4.4
    pre-up /sbin/ifconfig lan0 up
    

    Again, I very much appreciate any and all help with getting this feature enabled.

    #1282

    OV
    Participant

    … and I guess to clarify things a bit, I ran ‘arp -a’ from a remote machine and confirm that both addresses are responding with the same MAC address, even though both RJ-45 ports are plugged in.

    
    ? (192.168.0.21) at f0:ad:4e:03:87:07 [ether] on eth0
    ? (192.168.0.20) at f0:ad:4e:03:87:07 [ether] on eth0
    
    #1283

    chris
    Participant

    Have you checked what mac address are associated with each interface?
    Do lan0 and lan1 both have that same mac?

    #1284

    Trblz
    Participant
    auto lan0
    iface lan0 inet static
    address 192.168.0.21
    netmask 255.255.0.0
    network 192.168.0.0
    #broadcast 192.168.255.255
    gateway 192.168.0.1
    dns-nameservers 8.8.8.8 8.8.4.4
    pre-up /sbin/ifconfig lan0 up

    should this not be
    pre-up /sbin/ifconfig eth0 up

    ?

    #1285

    OV
    Participant

    Chris, thank you for replying. Yes, they all have the same MAC addy.

    > ifconfig -a | grep HWaddr

    bond0 Link encap:Ethernet HWaddr a2:16:b6:2b:f2:c4
    eth0 Link encap:Ethernet HWaddr f0:ad:4e:03:87:07
    lan0 Link encap:Ethernet HWaddr f0:ad:4e:03:87:07
    lan1 Link encap:Ethernet HWaddr f0:ad:4e:03:87:07
    wan Link encap:Ethernet HWaddr f0:ad:4e:03:87:07

    [BREAK]

    Trblz, thank you for replying too. Yes, that was the result of me trying to get the thing to work. I find success with “pre-up /sbin/ifconfig eth0 up”, but both IP addresses are still assigned to the left-most RJ45 port. No response on the middle port.

    #1286

    OV
    Participant

    … furthermore

    > lshw

    
      *-network:0
           description: Ethernet interface
           physical id: 4
           logical name: eth0
           serial: f0:ad:4e:03:87:07
           size: 1Gbit/s
           capacity: 1Gbit/s
           capabilities: ethernet physical tp mii 1000bt-fd autonegotiation
           configuration: autonegotiation=on broadcast=yes driver=mvneta driverversion=1.0 duplex=full link=yes multicast=yes port=MII speed=1Gbit/s
      *-network:1 DISABLED
           description: Ethernet interface
           physical id: 5
           logical name: bond0
           serial: a2:16:b6:2b:f2:c4
           capabilities: ethernet physical
           configuration: autonegotiation=off broadcast=yes driver=bonding driverversion=3.7.1 firmware=2 link=no master=yes multicast=yes
      *-network:2
           description: Ethernet interface
           physical id: 6
           logical name: lan0
           serial: f0:ad:4e:03:87:07
           size: 10Mbit/s
           capacity: 1Gbit/s
           capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
           configuration: autonegotiation=on broadcast=yes driver=dsa driverversion=0.1 duplex=half firmware=N/A ip=192.168.0.21 link=no multicast=yes port=MII speed=10Mbit/s
      *-network:3 DISABLED
           description: Ethernet interface
           physical id: 7
           logical name: wan
           serial: f0:ad:4e:03:87:07
           size: 10Mbit/s
           capacity: 1Gbit/s
           capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
           configuration: autonegotiation=on broadcast=yes driver=dsa driverversion=0.1 duplex=half firmware=N/A link=no multicast=yes port=MII speed=10Mbit/s
      *-network:4
           description: Ethernet interface
           physical id: 8
           logical name: lan1
           serial: f0:ad:4e:03:87:07
           size: 100Mbit/s
           capacity: 1Gbit/s
           capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
           configuration: autonegotiation=on broadcast=yes driver=dsa driverversion=0.1 duplex=full firmware=N/A ip=192.168.0.20 link=yes multicast=yes port=MII speed=100Mbit/s
    
    #1301

    OV
    Participant

    and here is my settings from printenv

    
    eth1addr=00:00:00:00:51:82                                                                                                                                                                                                                 
    eth2addr=00:00:00:00:51:83                                                                                                                                                                                                                 
    ethact=neta0                                                                                                                                                                                                                               
    ethaddr=F0:AD:4E:03:87:07                                                                                                                                                                                                                  
    ethprime=egiga0
    
    #1315

    OV
    Participant

    So maybe my question should be something like this…

    Since there is one sticker spanning all three RJ45 ports displaying only one MAC address, is it true that there really aren’t three NICs on this board, but rather one NIC with an on-board switch that has three ports?

    #1316

    StefanB
    Participant

    Although the frontpanel ports are connected to a switch and not the CPU directly, this does not mean these are not separate.

    The switch has 4 external ports (3 are exposed on the Espressobin) and 1 CPU port. Each switch port can be configured to forward incoming packets to one of the other ports (“Switch” behaviour) or to the CPU port. Packets coming from the CPU are tagged so these are sent out on the correct physical port(s).

    The *default* configuration on the Espressobin is to forward packets on the WAN port to the CPU, and to have the two LAN ports connected internally in the switch.

    For more information, read:
    https://www.kernel.org/doc/Documentation/networking/dsa/dsa.txt
    https://www.kernel.org/doc/Documentation/networking/switchdev.txt

    #1317

    OV
    Participant

    Thank you for the explanation, StefanB. This makes a lot more sense. Cheers!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Signup to our newsletter

Technical specification tables can not be displayed on mobile. Please view on desktop