LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to create ip rule table? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-create-ip-rule-table-346392/)

yenonn 07-24-2005 10:01 PM

how to create ip rule table?
 
hi,

i am using fc2. i want to create a user define table for ip rule. how can i do it???

i been looking at the http://lartc.org/lartc.html, for documentation. but, no point to create it. thanks.

DoubleOTeC 07-24-2005 10:26 PM

if i understand correctly.. you should be able to search for iptables or firewall scripts to get an idea on how to use BASH, for example, to create a script for iptable rules.

yenonn 07-24-2005 11:36 PM

i am looking for multiple routing for 2 isp. i am not planning for iptables.

mpeg4codec 07-25-2005 12:11 AM

I was just investigating this..

There are a couple ways to do it. If the interfaces are relatively equal in terms of bandwidth, I would recommend using the teql0 qdisc like so:

tc qdisc add dev eth0 root teql0
tc qdisc add dev eth1 root teql0

Then, configure your [public] interfaces. Give teql0 a dummy IP. You don't necessarily have to do the first two commands if your IP addresses [and routes] are already assigned, such as by your PPP client for DSL or DHCP client for cable.

ip addr add dev eth0 1.1.1.1/24
ip addr add dev eth1 2.2.2.2/24
ip addr add dev teql0 10.1.1.1

Finally, set the default route via the teql interface.

ip route add default via 10.1.1.1 dev teql0

Finally, you'll need to turn off an option that controls whether Linux will watch the return path of a packet. Substitute your interface names into these commands:

echo 0 > /proc/sys/net/ipv4/conf/eth0/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/eth1/rp_filter

That should work for using teql.

If you're more interested in doing it with routing tables only, you'll need to have multipath routing enabled in the kernel. If you're using a stock kernel from your distro, you most likely have it. Bring up both interfaces using whatever commands you may use to do so. Once that is done, run:

ip route add default equalize

I personally have not tested it this way, but I have read that this is what works. Feel free to give it a try and let me know how it turns out.

yenonn 07-25-2005 01:02 AM

it was failed from the first prompt

tc qdisc add dev eth0 root teql0
RTNETLINK answers: Invalid argument

what is tc qdisc? any comprehensive documentations?? thanks

yenonn 07-25-2005 02:44 AM

prior to everything, first we have to modprobe sch_teql

mpeg4codec 07-25-2005 11:57 PM

tc is the traffic control command. qdisc stands for queuing discipline. The Linux Advanced Routing & Traffic Control HOWTO does a fairly good job of explaining it in chapter nine. I think it should be required reading for anyone interested in this stuff.


All times are GMT -5. The time now is 12:41 PM.