Thanks Thanks:  0
Ergebnis 1 bis 2 von 2
  1. #1
    Anfänger
    Registriert seit
    13.02.2019
    Beiträge
    1
    Thanks (gegeben)
    0
    Thanks (bekommen)
    0
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    Box 1:
    Zgemma H52.S
     
     

    How to set up two network interfaces eth0, eth1

    Hi,
    My box - Zgemma H5.2S, openatv-6.2-zgemmah52s-20190616

    I have two network interfaces connected to Zgemma:
    eth0 - in-build - 1 ISP
    eth1 - USB ethernet adapter - 2 ISP

    What I want is to acces internet on both interfaces.
    Outgoing traffic to specific IP xxx.xxx.xxx.xxx should use eth0, and rest outgoing traffic should use eth1.
    Incoming traffic from specific IP xxx.xxx.xxx.xxx should use eth0, and rest outgoing traffic should use eth1


    When I connected USB Ethernet Adapter, I see second interfaces LAN connection and LAN connection 2
    How to set up two network interfaces eth0, eth1-two_interfaces.png

    My settings:
    eth0
    How to set up two network interfaces eth0, eth1-eth0_settings.png

    eth1
    How to set up two network interfaces eth0, eth1-eth0_settings.png

    If I set up eth1 like this, internet works on eth1, but not work on eth0 - from GUI Enigma don't allow set up a second gateway (allow but after network restart,
    gateway on eth0 change state "Use a gateway" to "no")

    My configuration

    Code:
    root@zgemmah52s:~# cat /etc/network/interfaces
    # automatically generated by enigma2
    # do NOT change manually!
    
    
    auto lo
    iface lo inet loopback
    
    
    auto eth1
    iface eth1 inet static
      hostname $(hostname)
            address 10.144.199.44
            netmask 255.255.255.0
            gateway 10.144.199.1
    
    
    auto eth0
    iface eth0 inet static
      hostname $(hostname)
            address 192.168.1.183
            netmask 255.255.255.0

    Code:
    root@zgemmah52s:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:17:9A:20:9E:34
              inet addr:192.168.1.183  Bcast:0.0.0.0  Mask:255.255.255.0
              inet6 addr: 2a02:a31e:2342:bf70:217:9aff:fe20:9e34/64 Scope:Global
              inet6 addr: fe80::217:9aff:fe20:9e34/64 Scope:Link
              inet6 addr: fdf4:677a:9436:0:217:9aff:fe20:9e34/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1157 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3250 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:133183 (130.0 KiB)  TX bytes:4087225 (3.8 MiB)
    
    
    eth1      Link encap:Ethernet  HWaddr 00:E0:4C:36:57:61
              inet addr:10.144.199.44  Bcast:10.144.199.255  Mask:255.255.255.0
              inet6 addr: fe80::2e0:4cff:fe36:5761/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:56 errors:0 dropped:0 overruns:0 frame:0
              TX packets:166 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:6130 (5.9 KiB)  TX bytes:25600 (25.0 KiB)
    
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:6 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:372 (372.0 B)  TX bytes:372 (372.0 B)
    So I follow this tutorial:
    Two Default Gateways on One System - Thomas-Krenn-Wiki

    I added:

    Code:
    echo "1 GSM" >> /etc/iproute2/rt_tables
    ip route add 10.144.199.0/24 dev eth1 src 10.144.199.44 table GSM
    ip route add default via 10.144.199.1 dev eth1 table GSM
    ip rule add from 10.144.199.44/32 table GSM
    ip rule add to 10.144.199.44/32 table GSM
    next:
    /etc/init.d/network restart


    and I try test ping with -I parameters but no luck

    Code:
    root@zgemmah52s:~# ping -I eth0 172.217.16.3
    PING 172.217.16.3 (172.217.16.3): 56 data bytes
    ^C
    --- 172.217.16.3 ping statistics ---
    4 packets transmitted, 0 packets received, 100% packet loss
    
    
    
    
    
    
    root@zgemmah52s:~# ping -I eth1 172.217.16.3
    PING 172.217.16.3 (172.217.16.3): 56 data bytes
    64 bytes from 172.217.16.3: seq=0 ttl=47 time=85.936 ms
    64 bytes from 172.217.16.3: seq=1 ttl=47 time=62.161 ms
    64 bytes from 172.217.16.3: seq=2 ttl=47 time=77.819 ms
    ^C
    --- 172.217.16.3 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 62.161/75.305/85.936 ms
    Configuration:
    Code:
    root@zgemmah52s:~# ip route list table GSM
    default via 10.144.199.1 dev eth1
    10.144.199.0/24 dev eth1 scope link src 10.144.199.44


    Code:
    root@zgemmah52s:~# ip rule show
    0:      from all lookup local
    32764:  from all to 10.144.199.44 lookup GSM
    32765:  from 10.144.199.44 lookup GSM
    32766:  from all lookup main
    32767:  from all lookup default


    Code:
    root@zgemmah52s:~# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         10.144.199.1    0.0.0.0         UG    0      0        0 eth1
    10.144.199.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

    It is possible use two network interface on openATV?
    Miniaturansichten angehängter Grafiken Miniaturansichten angehängter Grafiken How to set up two network interfaces eth0, eth1-eth1_settings.png  

    •   Alt Advertising

       

  2. #2
    Senior Mitglied Avatar von s3n0
    Registriert seit
    02.01.2017
    Ort
    Slovakia
    Beiträge
    1.460
    Thanks (gegeben)
    91
    Thanks (bekommen)
    418
    Total Downloaded
    323,0 KB
    Total Downloaded
    323,0 KB
    ReceiverDanke
    Box 1:
    Vu+ Zero 4K
     
     
    Box 2:
    Vu+ Solo SE V2
     
     
    Box 3:
    Formuer F4-TURBO
     
     
    Do I understand this correctly ? Do you want to use two internet gateways at the same time ?

    Of course it is possible, but you have to set the conditions exactly under what circumstances the internet gateway will be used. So whether eth0 or eth1 will be used to communicate with the internet and under what circumstances. From the Internet, the system does not care whether eth0 or eth1 is used.

    It is the same as if you wanted to drive one car on two highways at the same time. You can choose the only first or only second highway under certain conditions. Or you can rotate them with this one car, based on an event. An exception could be multi-threaded processes and a multi-threaded operating system, which is still not used in most systems (unfortunately).

    However, despite some advanced configuration, it is possible to set up a Linux system that, for example, some ports will work through eth0 and some only through eth1. It requires a lot of knowledge about the configuration of computer networks in Linux (I'm not an expert).


Stichworte

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:28 Uhr.
Powered by vBulletin® Version 4.2.5 (Deutsch)
Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.
Resources saved on this page: MySQL 5,56%
Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)
vBulletin Skin By: PurevB.com