linux - How to route only specific subnet (source ip) to a particular
interface?
How to route only specific subnet (source ip) to a particular interface? OS: Linux
I know I can do easily by destination IP by using something like
route add 1.2.3.4/24 dev eth4
but I do not see how can route based on source IP.
Answer
You need to use policy based routing. Something kind of like
ip rule add from / table ip route add 1.2.3.4/24 via dev eth4 table
is either table name specified in /etc/iproute2/rt_tables or you can use numeric id ...
This pretty much says, that all traffic from 1.2.3.4/24 will be routed using routing table . IIRC it doesen't use the default table after going through this, so if you need other routes (ie. default gateway), you need to add them to the table as well.
Given a windows 8 host system (Intel Core i5) and a Linux Fedora host, I would like to determine the optimal setting for the paravirtual interface. Options are none Default Legacy minimal Hyper-V KVM This page suggest the selection is only based on the guest system: The biggest change in VirtualBox 5.0 is the introduction of paravirtualization support, bringing higher performance and time-keeping accuracy to supported guest operating systems (Hyper-V on Windows and KVM on Linux). Is that correct? Answer The VirtualBox Manual , in the section titled Paravirtualization providers explains very clearly when each should be used (emphasis added): Minimal: Announces the presence of a virtualized environment. Additionally, reports the TSC and APIC frequency to the guest operating system. This provider is mandatory for running any Mac OS X guests. KVM: Presents a Linux KVM hypervisor interface which is recognized by Linux kernels starting with version 2.6.25. VirtualBox's implementati...
I have Firefox 3.6 installed on my OS X (10.6) box. I would like to open an URL in the running Firefox instance (in a new tab or window, no matter) from the command line. I tried several ways, neither switches -new-tab , -new-window , -url , or none helped me. I always get the A copy of Firefox is already open. Only one copy of Firefox can be open at a time. error message. Answer running open http://www.superuser.com from the command line will (at least for me) open a new tab to superuser.com in firefox (which is my default browser)
How is Linux protected against viruses? This question was a Super User Question of the Week . Read the blog entry for more details or contribute to the blog yourself Answer Well, it factually is not... it's just less subject to hackers developing viruses that target Linux systems. Consumer grade computers usually run on Windows and thus, when targeting a wide audience, Windows is the way to go. Don't misunderstand Linux and viruses, there definitely ARE Linux viruses. Some distros have additional protection layers such as SELinux (See here ) in Ubuntu for example. Then there's the default firewall and the fact that alien files don't automatically have permission to be executed. Specific execution permission has to be granted before execution is possible. (See here ) Then there are several other factors that make Linux a hard place to be for viruses usually non-root users on linux systems have no to little executable files at their disposal that would allow for virus...
Comments
Post a Comment