0
votes

My device is running on Debian OS strech version (not desktop).

I am not an IT personal, but a programmer. I need to know how to configure the network on the debian so both PPP cellular modem & the ethernet interface can access the internet.

There are 3 network interfaces: 1. Ethernet interface enp1s0: dhcp client. (gets ip from the dhcp server and access to the internet) 2. Ethernet interface snp2s0: static ip 3. Modem PPP: wvdial gets access to the internet using the modem

/etc/network/interface file:

auto lo
iface lo inet loopback


allow-hotplug enp1s0
iface enp1s0 inet dhcp


auto enp2s0
iface enp2s0 inet static
address 10.0.13.1
netmask 255.0.0.0

manual ppp0
iface ppp0 inet wvdial


ip route
default via 10.0.0.100 dev enp1s0
10.0.0.0/24 dev enp1s0 proto kernel scope link src 10.0.0.11
10.0.0.0/8 dev enp2s0 proto kernel scope link src 10.0.13.1

/etc/resolv.conf file:
domain mydomain.local
search mydomain.local
nameserver 10.0.0.3


/etc/wvdial.conf file:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = AT+CGDCONT=1,"IP","internetg"
Init4 = AT+CGATT=1
Phone = *99***1#
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM2
ISDN = 0
Password = ''
Username = ''
 Auto DNS = Off

/etc/ppp/peers/wvdial file:
noauth
name wvdial
usepeerdns

Problem: 1. My device is running and enp1s0 is connected to the internet. (modem is down) 2. I then run command to perform dialup of the ppp: ifup ppp0 3. As a result the device ppp0 appears in the 'ip a' command, but the ethernet interface enp1s0 is not connected to the internet anymore and also the modem is not connected, but has ip which means there is some problem with routing table and/or dns. After dialup the ip route table does not have any default/rule for the PPP. ip route:

default via 10.0.0.100 dev enp1s0 10.0.0.0/24 dev enp1s0 proto kernel scope link src 10.0.0.11 10.0.0.0/8 dev enp2s0 proto kernel scope link src 10.0.13.1

After dialup I noticed that the /etc/resolv.conf file changed and the dns of the ethernet interface is deleted and now appears the PPP dns entries:

/etc/resolv.conf nameserver 194.90.0.11 nameserver 212.143.0.11 domain mydomain.local search mydomain.local

The network should behave as follows: 1. If both PPP and ethernet interface are up, then both should have access to the internet at the same time 2. If only 1 of the devices are up (PPP or ethernet interface) then it should work 3. Dialup/Dialdown should not affect the ethernet connection to the internet

What are the exact commands needed and file configuration in order to be able to have PPP and ethernet interface enp1s0 work at the same time? - ip routing table - dns

- wvdial

1

1 Answers

0
votes

for default route, add defaultroute and replacedefaultroute option to /etc/ppp/peers/wvdial file.