1
I want to be able to connect to a closed network through LAN but to also have the WiFi open for internet. To connect to the closed network I need to set a static IP on the Ethernet card and to have Internet through WiFi I need to leave it as automatic IP. If I close the WiFi connection I am able to ping and RDP computers on the closed network but when WiFi is on I can't, but I do have internet connectivity. I've tested this on a laptop with Windows 10 and on one with Windows 7 (both Pro versions) and they are both unable to do this. Is there any way to make this work?
This is the route table with WiFi off:
C:\Users\{username}>route print
===========================================================================
Interface List
13...62 f6 77 b9 d3 ef ......Microsoft Wi-Fi Direct Virtual Adapter
17...60 f6 77 b9 d3 f0 ......Microsoft Wi-Fi Direct Virtual Adapter #2
12...a4 4c c8 6e 6b 23 ......Intel(R) Ethernet Connection (5) I219-LM
4...60 f6 77 b9 d3 ef ......Intel(R) Dual Band Wireless-AC 8265
1...........................Software Loopback Interface 1
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 11.22.33.1 11.22.33.100 291
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
11.22.33.0 255.255.255.0 On-link 11.22.33.100 291
11.22.33.100 255.255.255.255 On-link 11.22.33.100 291
11.22.33.255 255.255.255.255 On-link 11.22.33.100 291
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 11.22.33.100 291
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 11.22.33.100 291
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 11.22.33.1 Default
===========================================================================
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 331 ::1/128 On-link
12 291 fe80::/64 On-link
12 291 fe80::d42:ffd8:4aec:9a54/128
On-link
1 331 ff00::/8 On-link
12 291 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
This is the route table with WiFi on:
C:\Users\{username}>route print
===========================================================================
Interface List
13...62 f6 77 b9 d3 ef ......Microsoft Wi-Fi Direct Virtual Adapter
17...60 f6 77 b9 d3 f0 ......Microsoft Wi-Fi Direct Virtual Adapter #2
12...a4 4c c8 6e 6b 23 ......Intel(R) Ethernet Connection (5) I219-LM
4...60 f6 77 b9 d3 ef ......Intel(R) Dual Band Wireless-AC 8265
1...........................Software Loopback Interface 1
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 44.55.66.1 44.55.66.66 50
0.0.0.0 0.0.0.0 11.22.33.1 11.22.33.100 291
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
11.22.33.0 255.255.255.0 On-link 11.22.33.100 291
11.22.33.100 255.255.255.255 On-link 11.22.33.100 291
11.22.33.255 255.255.255.255 On-link 11.22.33.100 291
44.55.66.0 255.255.255.0 On-link 44.55.66.66 306
44.55.66.66 255.255.255.255 On-link 44.55.66.66 306
44.55.66.255 255.255.255.255 On-link 44.55.66.66 306
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 11.22.33.100 291
224.0.0.0 240.0.0.0 On-link 44.55.66.66 306
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 11.22.33.100 291
255.255.255.255 255.255.255.255 On-link 44.55.66.66 306
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 11.22.33.1 Default
===========================================================================
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 331 ::1/128 On-link
12 291 fe80::/64 On-link
4 306 fe80::/64 On-link
12 291 fe80::d42:ffd8:4aec:9a54/128
On-link
4 306 fe80::4971:5ea9:33db:4cc7/128
On-link
1 331 ff00::/8 On-link
12 291 ff00::/8 On-link
4 306 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
Thank you, Liron Hallak
Show WiFi interface settings (IP-mask-gateway) and the same parameters You set to NIC interface. Show
route print
output with (no Inet) and without (Inet accessable) of setting NIC parameters. PS. I think the problem source is You try to set default gateway on the NIC interface - it's wrong, You must set route to LAN subnets only. Or maybe subnets of NIC and WiFi intersects - if so, we need much more info about You networks for to help You... – Akina – 2018-06-07T08:03:35.173The problem is that when WiFi and LAN are connected I do have internet but I can't access other computers on the network. The settings I have for the WiFi connection are all automatic, so it depends on the network I'm connecting to. I connected to my phones hotspot and to my office WiFi with no difference in the results. The settings on LAN are without DNS, I set a static IP and gateway. – Liron Hallak – 2018-06-10T06:35:53.680
Show any WiFi connection settings and route table when this connection is on (no LAN) and off (LAN accessible). Add it to Q. text. – Akina – 2018-06-10T17:17:38.880
I can't post print screens of network settings because this is sensitive material. How do I send route prints without reviling the static ip's? – Liron Hallak – 2018-06-12T07:04:25.677
I can't post print screens of network settings because this is sensitive material. 1) Do not post "print screen", post console route print command output (copy-paste); 2) Replace real addresses with some like "11.22.33.44" keep subnetting with accuracy (if exists). Private addresses do not need in replace. – Akina – 2018-06-13T04:40:29.143
didn't see your reply until now. Sorry. I'll add the prints as you requested. – Liron Hallak – 2018-07-19T07:20:43.457
Remove default route from your LAN NIC. Add static route to the LAN subnet(s) only via LAN NIC. – Akina – 2018-07-19T07:40:45.507
What @Akina said. Have both connected but make a more direct targeted static route for the wired LAN network you want to access. Route all traffic to that given subnet (/24?). The wired interface should have no default gateway. – xstnc – 2018-07-19T08:34:37.187
My LAN connection has to have a static IP and a default gateway. It's connected to a Sierra cellular router that connects me to an APN. My WiFi connection is dynamic so I receive the settings according to the network I connect to. – Liron Hallak – 2018-07-19T12:08:00.963
So the router acts as a VPN? You could still do the same, but without the default gateway. Just configure your cellular router as the next-hop for that IP-subnet in the static route. You don't need everything to traverse that VPN. If both NICs have a default GW, it will surely cause you problems. – xstnc – 2018-07-19T13:06:55.320
configure your cellular router as the next-hop for that IP-subnet in the static route - I have no idea how to do that. Also, if it means re configuring something in the router than I can't (not permitted). If both NICs have a default GW, it will surely cause you problems - LAN gateway is a must because of the router, WiFi gateway is there although it's set up for automatic addressing so it comes from the network I connect to. Am I screwed? – Liron Hallak – 2018-07-22T06:58:48.490
@LironHallak - You configure the static route on your client directly. In CMD, the command would look like this: route ADD <your vpn subnet> MASK <subnetmask> <gateway>. In a normal situation this could look like the following: route add 192.168.1.0 mask 255.255.255.0 10.0.1.1. Set your wired NIC to a static address, and use the static route on top. This ensures you will have no gw, but will route intended traffic through the cellular VPN. Not screwed at all I would say ;) – xstnc – 2018-07-23T08:34:15.913
Can you break this down for me a bit more. Right now my NIC settings have static IP 11.22.33.44, subnet 255.255.255.0 and GW 11.22.33.66. Do I need to remove just the GW? And then the command should be
route add 11.22.33.44 mask 255.255.255.0 11.22.33.66
? When I try that I get The route addition failed: The parameter is incorrect. – Liron Hallak – 2018-07-24T07:15:16.453@LironHallak - You're absolutely right! Just remove the GW from the NIC settings, leaving just IP and subnet. Also, the command is correct, as far as I can see. Try running the CMD as administrator while doing this. Also, if it kicks about wrong parameters, do a check by just typing "route"; it should give you an example of the correct syntax. I just added a route on my PC, so it should work. Mind that you need to add the "-p" flag to make the route persistent through reboots. A tip would be to add it with the -p after you have verified its working. – xstnc – 2018-07-25T20:34:22.423
I managed to add the route but still couldn't RDP to the remote computer, even before I turned on the WiFi. I think I'm going to leave this issue for now. It's mainly an inconvenience and I feel I don't have enough networking knowledge to deal with this by myself. Thank you for all your help. – Liron Hallak – 2018-07-26T07:32:17.210
@LironHallak that's quite interesting then! And I fully understand. Some more time and more steps would be needed to figure it out I guess. You're welcome! If you ever want to continue this, I'll be more than happy to assist further. – xstnc – 2018-07-26T07:42:32.743