Windows network routing

2

I'm working by my customer premises and they let me connect my private laptop on a dedicated Wi-Fi for internet access. It's nice for external consultants. The only issue is that we can't connect on a remote server on port 25. I suppose this policy is set up to avoid infected computers sending spam from their network.

As you can have guessed, this is something weird that I can't send mail at all. Fortunately, I've a 3G cell phone that I can connect by Bluetooth on my laptop. So when I want to send an e-mail, I have to disconnect from Wi-Fi, connect my phone, send the e-mail, disconnect phone and reconnect Wi-Fi. Kinda overhead.

My question is: how can I tell Windows 7 to use the Wi-Fi for every out connection, but if it's a connection on port 25, use the cell phone network? With this solution, I could let my phone connected all day without having to switch again and again.

Thanks a lot for your anwwers. Fabian

Fabian

Posted 2010-06-07T06:43:00.847

Reputation: 105

Answers

1

do the below only if you know what you are doing.

  • first open an admin right cmd.exe (i.e. windows key -> "cmd" then right click "cmd" and click "run as administrator")
  • run route print (this should show the interfaces)
  • then run route add dest mask netmask gateway metric metric IF ifcode where dest = destination (the mail server), mask = netmask (in your case is a single IP), gateway is the default gateway of the phone, metric (a small one), and ifcode the interface of your phone.

hope that helps

bubu

Posted 2010-06-07T06:43:00.847

Reputation: 9 283

Can we add a route only for a specific port and not a destination host? – Fabian – 2010-06-07T07:51:16.950

@fabianvilers No, the routing table only handles IP addresses. You would need a NAT/firewall which supports routing based on port to do that. I'm afraid I don't know any off the top of my head for Windows. – Darth Android – 2010-06-07T08:04:50.787

@fabianvilers, i think that is a limitation of window's routing system. @Darth Android is correct. – bubu – 2010-06-07T08:54:08.850

It's not exactly a limitation - IP routing only deals with IP addresses. Ports (TCP or UDP) are on a higher level. – user1686 – 2010-06-07T15:40:00.393

@grawity, i do agree with you that IP routing only deals with IP addresses, but policy-based routing (as in cisco routers) supports port, of course, so when we are talking about routing capability (in general), i think calling it a limitation is not exactly wrong :) – bubu – 2010-06-07T15:56:00.930

@bubu: Well, a consumer-oriented OS rarely needs the same set of capabilities as specialized Cisco hardware. – user1686 – 2010-06-08T09:39:57.080

@grawity - okay, okay. I agree with you. :) – bubu – 2010-06-08T15:36:10.730