problems with dual network.

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
aquliu
Posts: 15
Joined: Thu Jan 09, 2020 12:10 pm

problems with dual network.

Post by aquliu »

Hi guys recently I encountered a problem with my dietpi in dual network, here is the situation:

I have two networks.
one[1] is an local network used for some local web services, whose router-ip is 10.10.10.10
the other[2] connected to an Internet for online-use, whose router-ip is 192.168.1.1

Respectively, I tried access to network[1] via Ethernet successfully, and network[2] via WiFi successfully, too. But when both connected to dietpi, it got a mess:
I cannot access dietpi from computer(whose ip is 10.10.10.121) in local network or fom iphone(whose ip is 192.168.1.113) under the WiFi.

I googled it but the solution is for ubuntu using the command 'ipconfig' or 'route', which are not installed in dietpi. what should I do? Can I apt isntall an 'ipconfig' and follow the google solution or is there a dietpi-way for this? would it(ipconfig or route) broken the exist dietpi-config of network?

thanks for all of your reply!
aquliu
Posts: 15
Joined: Thu Jan 09, 2020 12:10 pm

Re: problems with dual network.

Post by aquliu »

Actually I just want to access to a few ip in the local network(among 10.10.10.1-10.10.10.255) via dietpi, the most common scene is completed online through the WiFi router (192.168.1.1).
User avatar
Joulinar
Posts: 3238
Joined: Sat Nov 16, 2019 12:49 am

Re: problems with dual network.

Post by Joulinar »

Hi,

merry Xmas and thanks for your message.
I googled it but the solution is for ubuntu using the command 'ipconfig' or 'route', which are not installed in dietpi.
ifconfig has been officially deprecated years back and was replaced by the ip suite

https://www.tecmint.com/ifconfig-vs-ip- ... iguration/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
aquliu
Posts: 15
Joined: Thu Jan 09, 2020 12:10 pm

Re: problems with dual network.

Post by aquliu »

thank you for your reply!

i just googled the usage of 'ip route', I think it can solute my problem.

but there is a new question, I cannot connect to two route via Ethernet&WiFi at the same time using dietpi-config

when one connected, another disconnected at the same time.what should I do?
User avatar
trendy
Posts: 200
Joined: Tue Feb 25, 2020 2:54 pm

Re: problems with dual network.

Post by trendy »

The trick here is to connect to the network 1, the local one, without applying the default gateway, or applying the gateway with a higher metric.
Therefore the gateway of the connection 2 which can get you to the internet will be the only one or the preferred one with a lower metric.
Post Reply