Created
April 2, 2016 17:15
-
-
Save tiernano/a9a642c4d029c0dcf8beb926b3588991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inserting routes in the adsl1 table | |
ip route add 192.168.1.0/24 dev eth0 scope link table adsl1 | |
ip route add default via 192.168.1.1 dev eth0 table adsl1 | |
# Inserting routes in the adsl2 table | |
ip route add 192.168.2.0/24 dev eth0 scope link table adsl2 | |
ip route add default via 192.168.2.1 dev eth0 table adsl2 | |
# ip rule is the source routing magic. This will redirect | |
# packets coming from source "X" to table "adsl1", "adsl2" or "default". | |
ip rule add from 192.168.1.0/24 table adsl1 | |
ip rule add from 192.168.2.0/24 table adsl2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment