Classic routing
– Happens based on the destination address of the ip packet
Classic routing tables
$ ip rule list 0: from all lookup local 32766: from all lookup main 32767: from all lookup default
The lookup order happens based on the priority (first column): local > main > default.
Policy-based routing
– Allows decision making on other parameters (e.g. source address)
– It requires more routing tables then classic routing
General workflow
- Add a new routing table
- Add rule(s) towards that table
- Add route(s) on that table
Possible scenario
PC / Laptop |-----------------------------------------------------| | Webbrowser 1 Webbrowser 2 | | (Office content) (Private content) | | | | | | | Proxy* | | | | | | Network interface 1 Network interface 2 | | (Network card, eth0, default) (USB slot, usb0) | |-----------------------------------------------------| | | Office LAN LTE modem | \-- Local server | | | DSL modem | | | \-----------\ /------------/ | Internet | Public server *) Config: Set source ip of outgoing packets to usb0 ip.