Two Gateway with one network device?

  • So, I have a bit of a weird setup. The thing is, I don't have a router with Internet Connection. But I do have a router that has been setup as a bridge. So the internet is coming from my main laptop. The problem was that if I bring my laptop to work, I don't have an internet connection to my OMV anymore. So I setup my old secondary laptop to share network and use that one. The thing is, If I was at home, I want the internet to come from my main laptop instead so I can shut down my second laptop and save electricity. But switching the DNS and Gateway from the Control Panel is a bit of a pain. Is there a different method/ solution to this problem?

    I tried using VLAN, when I ping google I managed to send the package, but failed to receive it back.

  • You can have the old laptop impersonate the main laptop by giving them the same staitc IP, but then you have to make sure only one of them is running in the home network at any tme.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • You can have the old laptop impersonate the main laptop by giving them the same staitc IP, but then you have to make sure only one of them is running in the home network at any tme.

    I don't think that will work because I do remote into the old laptop sometimes. I do find a guide here, but I don't know if it will work yet for my use case. And the tutorial is a bit hard to follow

    https://www.virtualizationhowt…net-connections-one-host/

  • There is no easy way. You will have to google "linux default gateway".


    Or do it via scripting

    1. loop forever:
      1. ping ip of main laptop
      2. if it is available
        1. check if DNS and gateway are set to main laptopo
          1. if not
            1. set DNS and gateway to main lapto
      3. if it fails
        1. check if DNS and gateway is set to old laptop
          1. if not
            1. set DNS and gateway to old laptop
      4. sleep 60 sec

    To change DNS / gateway you can use / reverse engeneer the rpc.php comand.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Fahrezy

    Hat den Titel des Themas von „Two Gateaway with one network device?“ zu „Two Gateway with one network device?“ geändert.
  • Does static route option on my router could help here? Networking is not my main suit. And although the script method might work (haven't tested it), the new problem emerge because it only fix my OMV Network, but not my router network, because my router has a Wi-Fi transmitter that I use to connect to my server wirelessly for my family's computers

  • Post a network sketch (including network names), I can not understand, what you are doing.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • How are "other PCs" connecteds to the internet?

    If you change the default gateway (that's what the main laptop / old laptop is) their config needs to be changed too.

    Are you using static IPs or do you have a DHCP somewhere hidden in the image?



    Btw. this is not OMV related.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • How are "other PCs" connecteds to the internet?

    From the router with Wi-Fi. I want for all of my computer to have one single internet source. So that I don't need multiple SIM Cards.


    Are you using static IPs or do you have a DHCP somewhere hidden in the image?

    Static only

    Btw. this is not OMV related.

    Yeah. But I don't know where else to ask. I'm gonna post this somewhere else.

  • From the router with Wi-Fi. I want for all of my computer to have one single internet source. So that I don't need multiple SIM Cards.

    So your router has a sim card and is connected to the internet?

    I understood that only the laptops on the wire are connected to the internet. How many connections to the internet do you havem, can you sketch these into the network schema?


    I think, what you want is not really possible, if you have the two laptops in the same network as the other clients.

    You need to get a router which can manage multiple WAN connections, but then your laptops will not be in the local network.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    I think the best place to ask your question would be at openwrt forums. I think openwrt would be the most cost effective way to do what you are trying to do. Even if you need to buy a used router that can run openwrt. You will need to give them better info about your desired setup to get better answers. As you see we are only guessing.

  • Finally found a solution! The reason I believe there is a way to do this is because my other pcs (from the diagram) always had internet connection when I switched network sources (Main Laptop or Old Laptop) even if I didn't change it's gateway. It turns out that my router support DHCP so the other pcs just use DHCP this whole time. So what I did is change the network interface on my omv to DHCP and boom! It works everytime without me getting into the control panel and change gateway

  • Fahrezy

    Hat das Label OMV 5.x hinzugefügt.
  • Fahrezy

    Hat das Label gelöst hinzugefügt.
  • How does your router know if internet connection is avaiable from main aptop or old laptop or does it provide internet connection itself?

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • How does your router know if internet connection is avaiable from main aptop or old laptop or does it provide internet connection itself?

    I think I need to wrote something better there. By router I mean both of my laptop. They are the one who give out the DHCP. My router is actually just a bridge remember?


    So to make it easier to understand. The router is both of my laptop. They are connected to the rest of the system with my router which is just a bridge in disguise. I wanted for every other machine in the same LAN to switch between the two router every time the other one got turned off. The way I resolved it is to set every computer in my system (not my two router) to use DHCP. It connect and get and IP address from the router that got turned on first (You see, my system doesn't actually turned on all the time). If I want my second laptop to be the router, then I just turned that one on first before turning on everything else, vice versa. The only downside is the fact that the IP address always change every time I switched router. At first I think this is a problem since my OMV is headless. But then I realized you could use the hostname in the web browser to get into the control panel.

  • Ok, now I understand. But this onl works, if you switch on the other computers after the "router" laptop. If yu change laptops while the other computers are running, they will have the wrong IP-addresses and you can not have the two "router"-laptops running at the same time.


    May work in your usage szenario, but in most other cases it will fail.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    You are walking to and from school in deep snow. Uphill both ways. If you want it to just work with no need to reboot everything look at openwrt. It can do dual wan with fail over rules. Then you can set your router ( the one now set to bridge) as the dhcp and dns. And you can give access to both laptops.


    Openwrt will give you many more options than just dual wan. And is way more flexible than any home type wireless I have seen. Plus it gets updated far more often.

  • Openwrt will give you many more options than just dual wan. And is way more flexible than any home type wireless I have seen. Plus it gets updated far more often.

    I tried using it. But can't figure out how to install it. My router is ZTE ZXHN H108N. There is an Openwrt firmware of it but I can't install it. My router said that the correct firmware file type is .ras while the openwrt is .bin


    If I want this to work even better then I just better off buy a better router and ISP subscription. But that mean resolving issues the "money way" and for me right now? Not an option. I will still try a better way to solve this with my current resource (including the openwrt), and if I do find it I'll post it here as well. But for now I got at least what I want

  • given your restrictions, there is no better way. Gateways are not meant to be moved/switched.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!