Adjustable routing

How do I go about changing my routing if I connect up to the Internet using an LTE/4G modem whilst connected to my home
LAN which has its own Internet Gateway?

The use of the modem only occurs from time to time.

Is there any way I can get the routing changed when I insert or eject the modem?
 
Assuming you have a USB modem. Create a file e.g. /etc/devd/modem.conf:
Code:
attach 100 {
        match "vendor"          "0xXXXX";
        match "product"         "0xYYYY";
        action "/home/balanga/bin/modem_attach.sh";
};
detach 100 {
        match "vendor"          "0xXXXX";
        match "product"         "0xYYYY";
        action "/home/balanga/bin/modem_detach.sh";
};
Then you can write those scripts modem_attach.sh and modem_detach.sh to do the job.
Something like:
Code:
route del X.X.X.X/A Y.Y.Y.Y
route add Z.Z.Z.Z/B W.W.W.W
 
Assuming you have a USB modem. Create a file e.g. /etc/devd/modem.conf:
Code:
attach 100 {
        match "vendor"          "0xXXXX";
        match "product"         "0xYYYY";
        action "/home/balanga/bin/modem_attach.sh";
};
detach 100 {
        match "vendor"          "0xXXXX";
        match "product"         "0xYYYY";
        action "/home/balanga/bin/modem_detach.sh";
};
Then you can write those scripts modem_attach.sh and modem_detach.sh to do the job.
Something like:
Code:
route del X.X.X.X/A Y.Y.Y.Y
route add Z.Z.Z.Z/B W.W.W.W

Thanks for the help with routing... I'm issuing the followings commands:-

Code:
net del default
net add default 192.168.3.1

This gives me access to the Internet via my LTE modem. Just need figure out how to get the scripts to work.
 
Back
Top