設定4g 網卡 - Linux

Jacky avatar
By Jacky
at 2018-12-04T14:21

Table of Contents


hi all,
how to configure (switch ) the network interface to ppp link.


i have been install and setup ppp config.
usb-modeswitch usb-modeswitch-data , ppp pppconfig
and add "4gppp0" interface in /etc/network/interfaces
then add default gw to ppp0.
but it always route to eth0 interface , how to change and configure it ?


#route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


//interfaces
allow-hotplug 4gppp0
iface 4gppp0 inet ppp
provider 4GLTE

#ifconfigure
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.103.x.x netmask 255.255.255.255 destination 10.64.64.64
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 125 bytes 7990 (7.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 138 bytes 9173 (8.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.101 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::ba27:ebff:fe9c:895b prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:9c:89:5b txqueuelen 1000 (Ethernet)
RX packets 2619 bytes 248234 (242.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2029 bytes 299771 (292.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1121 bytes 261710 (255.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1121 bytes 261710 (255.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


HW:
RPi 3 Model B


-----
Sent from JPTT on my HMD Global Nokia 5.1 Plus.

--
Tags: Linux

All Comments

shell浮點數運算問題

Margaret avatar
By Margaret
at 2018-12-03T22:44
我用unix 系統 寫sh時,遇到了一個bug ,就是浮點數無法運算 我使用ntpdate去校正時間, 並且記錄校正了多少時間 例如:需要校正的時間是 0.000304 s 我寫 ntpdate -p 10.37.82.23 andgt; time.txt NTP= grep delay time. ...

請益家目錄設定檔備份與維護方式

Jacky avatar
By Jacky
at 2018-12-03T00:33
不好意思打擾各位大大,想請教一下關於家目錄備份的原則, 同時也煩請大大們看一下我目前的策略還有哪些改進空間了 目前的工作環境:實驗室Server 跟 NFS、自己的主機 (Ubuntu) 因為前陣子才開始接觸 Linux,怕一個不小心動亂 Server 的東西, 所以基本上都是在自己主機上忙碌, ...

fil 一個執行檔分析工具

Lucy avatar
By Lucy
at 2018-12-02T19:34
有時候需要分析執行檔 Linux 上有 file 指令可以使用 可是 Windows 上一直找不到好的替代品 只好自己來了 https://github.com/joeky888/fil - ...

常常系統變成唯讀狀態,必須要執行fsck才正常

Damian avatar
By Damian
at 2018-11-28T23:11
最近常常出現用到一半系統不能更新、某些程式沒音效, 重開機後都會進入一個命令的模式,然後使用 fsck 修復, 這個月已經出現了三到四次了,會是新的 kernel 造成的嗎? OS: Ubuntu 18.10 kernel: 4.19.5 - ...

ubuntu 18.10 vsftpd 架設

Anthony avatar
By Anthony
at 2018-11-28T10:14
抱歉,問一下, 我電腦當 Server 用 ubuntu 18.10 版灌 vsftpd, Server 這台本機開網頁打 ftp://192.168.yy.xxx 連 ftp ok. 用另外一台電腦開網頁打 ftp://192.168.yy.xxx 連不上 ftp, 有點無助, 請幫忙我看一下, 我在 ...