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. |
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)------ |
Quote:
|
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/ |
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. |
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. |
The OP mentioned using a browser. I fail to see how that can be constrained to use one particular network interface.
|
Sorry...I have to ask. Why? What “problem” are you trying to solve?
|
Quote:
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. |
If it were port 80 then depending on distro some routing like iptables.
|
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?
|
Each NICs has its own IP address and gateways are same.
|
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. |