Multiple NIC, separate network access

  • Hi all,


    I'm trying to have a setup similar to the following but so far failing : Dedicate NIC to local traffic only


    I have two NICs installed (eth0 and eth1) and want to route all outbound (Internet) traffic from Sabnzbd to eth1 (UID 'sabnzbd'), so from reading above added the below iptables rules:


    Code
    sudo iptables -A OUTPUT -m owner --uid-owner sabnzbd -d 192.168.0.0/24 -j ACCEPT 
    sudo iptables -A OUTPUT -m owner --uid-owner sabnzbd \! -o eth1 -j REJECT


    However, Sabnzbd fails to connect (no error message, just downloads are not starting). Flushing the iptables rules makes it work again (although I can see from ifconfig that traffic then routes over eth0).


    What I have observed is that ping on interface eth1 does not resolve - which makes me think it's a gateway issue (?):




    Can anyone advise on what could be going wrong? Let me know if more information required.


    Thanks,
    Nicks

  • Just to clarify further for background in case it is needed, eth0 is connected to a router with a direct Internet connection, whereas eth1 is connected to a VPN router with Internet connection - other clients are using this VPN router without issue.


    Thanks,
    Nicks

  • Thanks for the reply - no, I have not created another routing table. I will read up on this - I assume it would be through iproute2 (?).


    If you have any guides, that would be much appreciated.

  • Unfortunately, still struggling to get to grips with this after reading up. I found the following guide which seems to fulfill my requirement: https://www.thomas-krenn.com/e…lt_Gateways_on_One_System


    Having followed, I'm still not able to ping successfully on eth1. Here is my ip route:


    Code
    default via 192.168.0.1 dev eth0
    192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.3
    192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.103


    and there is the new routing table I created 'rt2':


    Code
    default via 192.168.1.1 dev eth1
    192.168.1.0/24 dev eth1  scope link  src 192.168.1.103


    ip rules:


    Code
    0:      from all lookup local
    32764:  from all to 192.168.1.103 lookup rt2
    32765:  from 192.168.1.103 lookup rt2
    32766:  from all lookup main
    32767:  from all lookup default


    ping still failing:


    Code
    root@koopa:~# ping -I eth1 www.openmediavault.org
    PING www.openmediavault.org (178.254.11.33) from 192.168.1.103 eth1: 56(84) bytes of data.
    From koopa.local (192.168.1.103) icmp_seq=1 Destination Host Unreachable
    From koopa.local (192.168.1.103) icmp_seq=2 Destination Host Unreachable
    From koopa.local (192.168.1.103) icmp_seq=3 Destination Host Unreachable
    ^C
    --- www.openmediavault.org ping statistics ---
    4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3037ms
    pipe 3
    root@koopa:~#



    Any ideas why?


    Thanks,
    Nicks

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!