Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.networking > #4308 > unrolled thread
| Started by | jonny <john@b.good> |
|---|---|
| First post | 2019-02-07 17:32 +0100 |
| Last post | 2019-02-08 12:17 -0700 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.os.linux.networking
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
| From | jonny <john@b.good> |
|---|---|
| Date | 2019-02-07 17:32 +0100 |
| Subject | how set 2 network interface |
| Message-ID | <q3hmir$s41$1@gioia.aioe.org> |
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
[toc] | [next] | [standalone]
| From | William Unruh <unruh@invalid.ca> |
|---|---|
| Date | 2019-02-07 16:47 +0000 |
| Message-ID | <q3hneb$qrr$1@dont-email.me> |
| In reply to | #4308 |
On 2019-02-07, jonny <john@b.good> 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 The computer will pick one or the other of eth0 or usb0 for the default. It will depend on which was set up last. Both 192.168.1.0 and 192.168.42.0 are internal networks. So you want to get rid of the first entry. And you want to set up your system to set this up at boot, not you doing it by hand each time you reboot. What OS do you have? > > > 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. Have you tried reading man route?
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2019-02-08 11:41 +0100 |
| Message-ID | <e030jf-f4c.ln1@Telcontar.valinor> |
| In reply to | #4309 |
On 07/02/2019 17.47, William Unruh wrote: > On 2019-02-07, jonny <john@b.good> 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 > The computer will pick one or the other of eth0 > or usb0 for the default. It will depend on which was set up last. No, on metric. -- Cheers, Carlos.
[toc] | [prev] | [next] | [standalone]
| From | Grant Taylor <gtaylor@tnetconsulting.net> |
|---|---|
| Date | 2019-02-07 11:56 -0700 |
| Message-ID | <q3hv51$av1$1@tncsrv09.home.tnetconsulting.net> |
| In reply to | #4308 |
On 2/7/19 9:32 AM, jonny wrote: > 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. It looks like both eth0 and usb0 are likely DHCPing for their IP and gateway. I'm also guessing that eth0 is connected at a faster speed than usb0. I say this based on the metric. (I'm thinking the difference in the metric may be speed related.) You need to remove the route that is the default gateway from eth0. ip route del 0.0.0.0 via 192.168.1.1 That should do it. As William indicated, you'd likely not want to have to do this on every boot. So, check to see if you can alter the network config for eth0 to not automatically add the default gateway, or do so with a higher metric so that the routing table will prefer the usb0 connected gateway. -- Grant. . . . unix || die
[toc] | [prev] | [next] | [standalone]
| From | Marc Haber <mh+usenetspam1118@zugschl.us> |
|---|---|
| Date | 2019-02-08 09:54 +0100 |
| Message-ID | <q3jg43$3c9$1@news1.tnib.de> |
| In reply to | #4308 |
jonny <john@b.good> wrote: >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. You should investigate where the wrong default route on eth0 comes from. Something must set it to 192.168.1.1. Is 192.168.1.1 a router that runs DHCP and wrongly thinks it has Internet? Greetings Marc -- -------------------------------------- !! No courtesy copies, please !! ----- Marc Haber | " Questions are the | Mailadresse im Header Mannheim, Germany | Beginning of Wisdom " | Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834
[toc] | [prev] | [next] | [standalone]
| From | Chris Elvidge <chris@mshome.net> |
|---|---|
| Date | 2019-02-08 11:21 +0000 |
| Message-ID | <q3joo7$ogf$1@dont-email.me> |
| In reply to | #4308 |
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
[toc] | [prev] | [next] | [standalone]
| From | Grant Taylor <gtaylor@tnetconsulting.net> |
|---|---|
| Date | 2019-02-08 12:17 -0700 |
| Message-ID | <q3kkp2$32e$1@tncsrv09.home.tnetconsulting.net> |
| In reply to | #4313 |
On 2/8/19 4:21 AM, Chris Elvidge wrote:
> Unfortunately, route sometimes does not (reliably) remove a default route.
What are you talking about?
I've never had "route" or "ip -{4,6} route" not remove a route when I
tell it to do so.
Are you talking about the fact that they will add a second default
gateway without removing the existing one? If so, I think that's
intended behavior.
--
Grant. . . .
unix || die
[toc] | [prev] | [standalone]
Back to top | Article view | comp.os.linux.networking
csiph-web