LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   How to Force an Application to Use a Specific Network Card? (https://www.linuxquestions.org/questions/linux-desktop-74/how-to-force-an-application-to-use-a-specific-network-card-4175683762/)

n00b_noob 10-16-2020 03:44 PM

How to Force an Application to Use a Specific Network Card?
 
Hello,
Is it possible to Force an Application to Use a Specific Network Card? For example, I have two NIC and I want my browse use eth1.

Thank you.

ferrari 10-16-2020 04:36 PM

You can't. However, if eth1 is connected to a router acting as an internet gateway, that interface will be used for internet connectivity. For example...

Internet-----GW Router(192.168.1.1)------(eth1, 192.168.1.5)Host(eth2, 192.168.2.5)------

n00b_noob 10-17-2020 09:09 AM

Quote:

Originally Posted by ferrari (Post 6175989)
You can't. However, if eth1 is connected to a router acting as an internet gateway, that interface will be used for internet connectivity. For example...

Internet-----GW Router(192.168.1.1)------(eth1, 192.168.1.5)Host(eth2, 192.168.2.5)------

If both of my NICs has Internet?

ferrari 10-17-2020 03:46 PM

The routing table(s) will determine which gateway is used in these circumstances. Policy based routing would generally be employed. For example...

https://www.linuxmaker.com/en/linux/...-gateways.html
https://kindlund.wordpress.com/2007/...utes-in-linux/

martin smith 10-29-2020 11:31 AM

You have to give the full path to your program
If the path contains spaces, enclose it in quotes
You will have to launch the program via this method every time you want to bind it to that network card.

jefro 10-29-2020 08:03 PM

Some progams have settings either in text of via config that could select.

Some programs might work in a layer 7+ router.

If we knew more about your question then maybe better answer.

ferrari 10-29-2020 08:26 PM

The OP mentioned using a browser. I fail to see how that can be constrained to use one particular network interface.

scasey 10-29-2020 08:59 PM

Sorry...I have to ask. Why? What “problem” are you trying to solve?

dugan 10-30-2020 05:02 PM

Quote:

Originally Posted by n00b_noob (Post 6175973)
Hello,
Is it possible to Force an Application to Use a Specific Network Card? For example, I have two NIC and I want my browse use eth1.

Thank you.

Yes, but the setup I'm going going to describe is probably not what you wanted to hear.

The computer with two NICs is a router. Its eth1 connects to its own subnet. The only computer on that subnet is a kiosk that only runs that web browser.

jefro 10-30-2020 05:23 PM

If it were port 80 then depending on distro some routing like iptables.

Skaperen 11-05-2020 07:33 PM

are your 2 NICs configured with the same IP address or different? your gateway to the internet, does each NIC use the same one or 2 different gateways?

n00b_noob 11-17-2020 10:52 AM

Each NICs has its own IP address and gateways are same.

martin smith 11-24-2020 10:08 AM

You have to give the full path to your program.
If the path contains spaces, enclose it in quotes.
You will have to launch the program via this method every time you want to bind it to that network card.


All times are GMT -5. The time now is 10:52 AM.