How to make a dedicated Ethernet port on a dual Ethernet supported Linux device, which can work independently from the default port?

0

In a Cortex-A5 based Linux board, I have connected an external Ethernet through SPI protocol. Now the system has 2 Ethernet port. After modifying the file /etc/network/interfaces, I got 2 different IP. Here eth0 is the internal port and eth1 is the external port. I have made eth0 as the default route.

root@iSense-V4:~# ip route
default via 10.1.1.1 dev eth0 
10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.45 
10.1.1.0/24 dev eth1 proto kernel scope link src 10.1.1.46

Both are working fine, but if I remove the cable of the default route port "eth0", none of the IP are becoming unreachable. If I remove the eth1 and connect only eth0 both the IPs are becoming reachable. But I want the eth1 port to work independently from the eth0. Is there any way to do so? Can you please help me with this? Here is a detailed information regarding both the port

root@iSense-V4:~# ethtool eth1
Settings for eth1:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: No
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Speed: 10Mb/s
    Duplex: Half
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
    MDI-X: Unknown
    Current message level: 0x00000036 (54)
                   probe link ifdown ifup
root@iSense-V4:~# 

root@iSense-V4:~# ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 7
    Transceiver: internal
    Auto-negotiation: on
    Link detected: yes
root@iSense-V4:~# 

Here is the network configuration in /etc/network/interfaces

auto eth0 eth1
iface eth0 inet static
    address 10.1.1.45
    netmask 255.255.255.0
    network 10.1.1.0
    gateway 10.1.1.1

iface eth1 inet static
        address 10.1.1.46
        netmask 255.255.255.0
        network 10.1.1.0
        gateway 10.1.1.1
linux
networking
ip
embedded-linux
asked on Stack Overflow May 10, 2020 by Gururprasad Prusty • edited May 10, 2020 by Gururprasad Prusty

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0