Raised This Month: $12 Target: $400
 3% 

Two IP addresses, one server, please help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nitz
Member
Join Date: Oct 2007
Old 08-19-2012 , 23:20   Two IP addresses, one server, please help.
Reply With Quote #1

Here in Brazil we have some serious issues with routing hence most players from ISP X will likely lag a lot more than players from ISP Y, fortunately I got two connections, one is a 35Mbps vdsl with 5Mbps upload and the other one is a regular dsl 15Mbps with 1Mbps upload.

My server has two nics, ISP #1 is 192.168.1.10 and ISP #2 is 10.0.0.10, both behind routers and properly forwarded.

I can connect from either internal IPs just fine but I can't connect from the external IP of the second IP for nothing, I've set the "ip 0.0.0.0" so HLDS will listen on all IPs but no luck.

If I disable the ISP #1 ethernet adapter the ISP #2 works just fine.

What I can't understand is the fact I can connect from both internal IPs just fine which shows me HLDS can handle more than an IP but why the traffic forwarded from ISP #2 wont hit the HLDS server?

Thanks
nitz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-19-2012 , 23:27   Re: Two IP addresses, one server, please help.
Reply With Quote #2

Neither of those IPs are assigned by your ISP(s). It's just not possible. Both of those IPs are reserved for internal private networks. Only those connected to your router directly (wired or wireless or maybe VPN) will be able to access those IPs.

See: Reserved IP Addresses
__________________

Last edited by fysiks; 08-19-2012 at 23:28.
fysiks is offline
nitz
Member
Join Date: Oct 2007
Old 08-19-2012 , 23:43   Re: Two IP addresses, one server, please help.
Reply With Quote #3

Both are directly connected to my two routers and forwarded as I mentioned in the first post.

The 2 IP addresses are accessible outside by an external IP address which is acquired by my routers but HLDS refuses to work externally with ISP #2 unless I shut down ISP #1.
nitz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-20-2012 , 00:00   Re: Two IP addresses, one server, please help.
Reply With Quote #4

So, the computer that is running HLDS has two network cards? Maybe HLDS can only interact with one at a time.
__________________
fysiks is offline
nitz
Member
Join Date: Oct 2007
Old 08-20-2012 , 00:10   Re: Two IP addresses, one server, please help.
Reply With Quote #5

Yep, it has two network cards, I thought the same but the internal LAN IP addresses are both working to connect with HLDS.

Since the router redirects the traffic to the internal IP I don't see why it shouldn't work but it's not, that's what getting me confused!
nitz is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-20-2012 , 16:37   Re: Two IP addresses, one server, please help.
Reply With Quote #6

HLDS binds itself to 1 IP and only 1 IP. You can attempt to bind it to 0.0.0.0 and see if it will then accept traffic from both. If it doesn't, you can always try and use iptables to redirect the trafic, I've never done it with IPs before, just ports.

If this doesn't work, then you will need to accept that it is not possible
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-22-2012 , 13:54   Re: Two IP addresses, one server, please help.
Reply With Quote #7

You can play with some nat rules on iptables (only linux) to let all packets go to hlds ip/port.

The problem is the response will try to go out with just 1 ip address.
That can be fixed if you route SOME USERS to ISP1 and OTHER USERS to ISP2 in your internal network.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 08-22-2012 at 13:55.
joropito is offline
Send a message via MSN to joropito
nitz
Member
Join Date: Oct 2007
Old 08-24-2012 , 22:05   Re: Two IP addresses, one server, please help.
Reply With Quote #8

Ok, thank you for the helpful responses so far.

HLDS does accept connections from many IP addresses within the local LAN however it doesn't respond to more than one WAN external IP for some unknown reason.

I've successfully made it work with both WANs and my players are very happy, they can now choose which connection is less laggy for them and that's great for me since I am balancing the load between them.

pfSense did the trick, a FreeBSD based firewall I set up on a mini-itx box with a dual lan intel motherboard plus a dual wan pci-e low profile card. Works wonderfully, either IPs accept connections and I've been using it for a couple of days.

Was pretty easy, except for finding the low profile gbit card.

Thank you

Last edited by nitz; 08-24-2012 at 22:06.
nitz is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 08-24-2012 , 22:28   Re: Two IP addresses, one server, please help.
Reply With Quote #9

Quote:
Originally Posted by joropito View Post
The problem is the response will try to go out with just 1 ip address.
That can be fixed if you route SOME USERS to ISP1 and OTHER USERS to ISP2 in your internal network.
Reason why it goes out through 1 (main) ip is because all the network interface are using your main routing table. If you want the incoming connection to go out through the same interface it originally comes in, you should set up a new routing table for each of the interfaces. You don't need to mess with iptables. This is how I did it back then to selectively route app through particular network interface when I was connected to multiple wifi simultaneously
__________________
HLDSWatch - HLDS monitoring and auto restarter script

Last edited by Mlk27; 08-24-2012 at 22:30.
Mlk27 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode