Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:50:08+00:00 2026-06-10T05:50:08+00:00

I have a PC with two network interfaces: eth0 and eth1. eth0 – Has

  • 0

I have a PC with two network interfaces: eth0 and eth1.

eth0 – Has an ip of 192.168.11.X/24.

eth1 – Has an ip of 192.168.130.X/24. eth1 has internet connectivity.

How does my OS know which interface to use when I try connecting to the internet? Does it iterate over all default gateways? Does it have any cache of what each interface provides? Is there any difference in the behaivior between Windows and Linux?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:50:09+00:00Added an answer on June 10, 2026 at 5:50 am

    I’m going to answer for the Linux side of the house (at least for Debian-based systems, such as Ubuntu, since it’s more common for users at this point):

    Type the following into a command line:

    route -n
    

    You should see your “routing table” appear, with something like the following:

    Destination    Gateway          Genmask         ...    Iface
    0.0.0.0        192.168.11.254   0.0.0.0         ...    eth0
    169.254.0.0    0.0.0.0          255.255.0.0     ...    eth0
    192.168.11.0   0.0.0.0          255.255.255.0   ...    eth0
    192.168.130.0  0.0.0.0          255.255.255.0   ...    eth1
    

    I omitted a couple columns, but basically, the line that says “0.0.0.0” under “Destination” is the line that determines where your default route is. In other words, where all of the traffic goes that isn’t destined for any of the other subnets in the other lines (google.com, facebook.com, whatever).

    If it’s not right (such as in the above table, where “eth1” is the card you want with Internet access), you should change the default route:

    sudo route del default
    sudo route add default gw 192.168.130.254 netmask 255.255.255.0
    

    That will fix it for now. To make it permanent, edit your interfaces file:

    sudo gedit /etc/network/interfaces
    

    Edit it to look something like the following (change as necessary to your specific situation):

    auto eth0
    iface eth0 inet dhcp
    up route del default
    
    auto eth1
    iface eth1 inet dhcp
    up route add default gw 192.168.130.254 netmask 255.255.255.0
    

    Then restart networking to see if that did the trick:

    sudo /etc/init.d/networking restart
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two network interfaces on my Solaris machine and the output of ifconfig
I have a machine with VmWare installed which added two extra network interfaces. The
I have a server with two different network interfaces, each with a different IP
I have a linux server with two NICs (eth0 and eth1), and have set
I have two network board in my pc: The main one has the local
I have two network interfaces(Wireless and Ethernet) for connection but I just want to
I have two Java applications in my network that talk to each other over
I have two folders, for arguments sake /Volumes/A and /Volumes/B. They are mounted network
I'm trying to capture packets from two devices on my network. I have tcpdump
I have a web service on IIS and I have two network interface cards.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.