<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Policy_Based_Routing</id>
	<title>Policy Based Routing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Policy_Based_Routing"/>
	<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=Policy_Based_Routing&amp;action=history"/>
	<updated>2026-05-22T19:44:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://hurlster.com/wiki/index.php?title=Policy_Based_Routing&amp;diff=2374&amp;oldid=prev</id>
		<title>Gqwill69: /* Add to startup */</title>
		<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=Policy_Based_Routing&amp;diff=2374&amp;oldid=prev"/>
		<updated>2011-04-17T04:31:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Add to startup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Build Policy Based Routing ==&lt;br /&gt;
This method only uses ip route not iptables&lt;br /&gt;
 user@server:~$ netstat -rne&lt;br /&gt;
 Kernel IP routing table&lt;br /&gt;
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;
 167.142.40.128  0.0.0.0         255.255.255.224 U     0      0        0 eth1&lt;br /&gt;
 192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0&lt;br /&gt;
 0.0.0.0         192.168.0.1     0.0.0.0         UG    200    0        0 eth0&lt;br /&gt;
&lt;br /&gt;
 #echo 1 1 &amp;gt;&amp;gt; /etc/iproute2/rt_tables&lt;br /&gt;
 #echo 2 2 &amp;gt;&amp;gt; /etc/iproute2/rt_tables&lt;br /&gt;
&lt;br /&gt;
 #ip route add default via 192.168.0.254 dev eth0 table 1&lt;br /&gt;
 #ip route add default via 167.142.40.142 dev eth1 table 2&lt;br /&gt;
&lt;br /&gt;
 #ip route show table 1&lt;br /&gt;
 default via 192.168.0.1 dev eth0&lt;br /&gt;
&lt;br /&gt;
 #ip route show table 2&lt;br /&gt;
 default via 167.142.40.129 dev eth1&lt;br /&gt;
&lt;br /&gt;
 #ip rule add from 192.168.0.254/32 table 1 priority 500&lt;br /&gt;
 #ip rule add from 167.142.40.142/32 table 2 priority 600&lt;br /&gt;
&lt;br /&gt;
 #ip rule show&lt;br /&gt;
 0:      from all lookup local &lt;br /&gt;
 500:  from 192.168.0.254 lookup 1&lt;br /&gt;
 600:  from 167.142.40.142 lookup 2 &lt;br /&gt;
 32766:  from all lookup main &lt;br /&gt;
 32767:  from all lookup 253 &lt;br /&gt;
&lt;br /&gt;
 #ip route flush cache&lt;br /&gt;
&lt;br /&gt;
=== Add to startup ===&lt;br /&gt;
 root@server:~# more /etc/rc.local &lt;br /&gt;
 #!/bin/sh -e&lt;br /&gt;
 #&lt;br /&gt;
 # rc.local&lt;br /&gt;
 #&lt;br /&gt;
 # This script is executed at the end of each multiuser runlevel.&lt;br /&gt;
 # Make sure that the script will &amp;quot;exit 0&amp;quot; on success or any other&lt;br /&gt;
 # value on error.&lt;br /&gt;
 #&lt;br /&gt;
 # In order to enable or disable this script just change the execution&lt;br /&gt;
 # bits.&lt;br /&gt;
 #&lt;br /&gt;
 # By default this script does nothing.&lt;br /&gt;
 &lt;br /&gt;
 # Policy Based Routing&lt;br /&gt;
 ip route add default via 192.168.0.254 dev eth0 table 1&lt;br /&gt;
 ip route add default via 167.142.40.142 dev eth1 table 2&lt;br /&gt;
 ip rule add from 192.168.0.254/32 table 1 priority 500&lt;br /&gt;
 ip rule add from 167.142.40.142/32 table 2 priority 600&lt;br /&gt;
 ip route flush cache&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
== USB Network Interface ==&lt;br /&gt;
USB 2.0 dongle doesn&amp;#039;t pass traffic but shows up and active&amp;lt;br&amp;gt;&lt;br /&gt;
Manual driver installation is required.&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.hurlster.com/wiki/AX88772B_772A_760_772_178_LINUX_Driver_v4.1.0_Source.tar.bz2&lt;br /&gt;
&lt;br /&gt;
=== USB Installation ===&lt;br /&gt;
1. Extract the compressed driver source file to your template directory by the following command:&lt;br /&gt;
        [root@localhost template]# tar -xf DRIVER_SOURCE_PACKAGE.tar.bz2&lt;br /&gt;
&lt;br /&gt;
2. Now, the driver source files should be extracted under the current directory. Executing the following command to compile the driver:&lt;br /&gt;
         [root@localhost template]# make&lt;br /&gt;
&lt;br /&gt;
3. If the compilation is well, the asix.ko will be created under the current directory.&lt;br /&gt;
 &lt;br /&gt;
4. If you want to use modprobe command to mount the driver, executing the following command to install the driver into your Linux:&lt;br /&gt;
        [root@localhost template]# make install&lt;br /&gt;
&lt;br /&gt;
=== USB Usage ===&lt;br /&gt;
1. If you want to load the driver manually, go to the driver directory and execute the following commands:&lt;br /&gt;
        [root@localhost template]# insmod asix.ko&lt;br /&gt;
&lt;br /&gt;
2. If you had installed the driver during driver compilation, then you can use the following command to load the driver automatically.&lt;br /&gt;
        [root@localhost anywhere]# modprobe asix&lt;br /&gt;
&lt;br /&gt;
If you want to unload the driver, just executing the following command:&lt;br /&gt;
        [root@localhost anywhere]# rmmod asix&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Gqwill69</name></author>
	</entry>
</feed>