Debian - set default gateway from script or ??
Hello everyone,
I like to find my answers by reading rather than posting.
But this time i have no clues on solving this issue i have.
It's a mini pc with debian arm7 install and Huaweiy MU609 modem in a PCI-e slot.
so just a basic linux pc with GSM modem right.
Well this one has a TCP stack as well, so i am connecting to data provider and geting the IP address on a eth1.
eth0 is LAN for troubleshoting.
Problem is setting the gateay to be on GSM modem eth1 interface.
The pc always puts the gateway to be on address for the LAN after reboot.
I can not disable LAN cause i need it for troubleshoting.
I made a script to delete default gw after boot, but to add current one is another story.
when connecting to GSM provider i get a diffferent IP and gateway every time, so ...
how do i set the gateway dinamically and be sure i'll have internet access ??
this gives me a gateway ip:
ip addr show eth1 | grep inetb | awk '{print }' | cut -d/ -f1
but how do i enter it in the
ip route add default via xxx.xxx.xxx.xxx
ip route expects to se numbers only there. I tried with variables from a script
bu no go.
on red hat there is a GATEWAYDEV=ethX command, which does not exist in Debian.
ANy help greatly appreciated.
Thank You
|