Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #4313

Re: how set 2 network interface

From Chris Elvidge <chris@mshome.net>
Newsgroups comp.os.linux.networking
Subject Re: how set 2 network interface
Date 2019-02-08 11:21 +0000
Organization A noiseless patient Spider
Message-ID <q3joo7$ogf$1@dont-email.me> (permalink)
References <q3hmir$s41$1@gioia.aioe.org>

Show all headers | View raw


On 07/02/2019 16:32, jonny wrote:
> 
> Hello,
> 
> I have 2 network interface, eth0 and usb0.
> I'm looking for set one for outgoing packet on the internet, and other 
> to internal lan.
> 
> This is the network:
> 
> route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use 
> Iface
> 0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 
> eth0
> 0.0.0.0         192.168.42.129  0.0.0.0         UG    204    0        0 
> usb0
> 192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 
> eth0
> 192.168.42.0    0.0.0.0         255.255.255.0   U     204    0        0 
> usb0
> 
> 
> I would set eth0 for internal lan, and usb0 as default route for internet.
> I know I must use the route command, but I don't know exactly to do it.
> 
> Thanks

Unfortunately, route sometimes does not (reliably) remove a default route.

Are you using dhcpcd or dhclient or NetworkManager or static for eth0?

Are your interfaces defined in /etc/network/interfaces or /etc/dhcpcd.conf

do a 'ps ax | grep dhc'

if you see dhcpcd, add a line "nogateway" to your eth0 spec in dhcpcd.conf

if you see dhclient, add a line "metric 300" to the eth0 spec in 
interfaces if dhcp OR make sure there is no "gateway" line in he eth0 spec



-- 

Chris Elvidge, England

Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how set 2 network interface jonny <john@b.good> - 2019-02-07 17:32 +0100
  Re: how set 2 network interface William Unruh <unruh@invalid.ca> - 2019-02-07 16:47 +0000
    Re: how set 2 network interface "Carlos E.R." <robin_listas@es.invalid> - 2019-02-08 11:41 +0100
  Re: how set 2 network interface Grant Taylor <gtaylor@tnetconsulting.net> - 2019-02-07 11:56 -0700
  Re: how set 2 network interface Marc Haber <mh+usenetspam1118@zugschl.us> - 2019-02-08 09:54 +0100
  Re: how set 2 network interface Chris Elvidge <chris@mshome.net> - 2019-02-08 11:21 +0000
    Re: how set 2 network interface Grant Taylor <gtaylor@tnetconsulting.net> - 2019-02-08 12:17 -0700

csiph-web