|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Port forwarding dilemna
I'm using a Debian Linux system as a router for my cable connection, using iptables. I'm forwarding some ports for certain programs to work correctly & I've run into a problem.
I just started using a laptop as my primary system & I'm trying to figure out how to forward those ports to the correct IP address whether I'm using the wired NIC or the wireless card. Now, of course each network interface is assigned a different IP by the DHCP server (also running on the Linux router), so I'm not sure what can be done to accomplish the port forwarding. Does anyone have ideas? EDIT: I'm currently running Windows XP Pro on the laptop, BTW. |
|
#2
|
||||
|
||||
|
Quote:
Your DHCP server should allow you to always assign certain IP addresses to certain MAC addresses, so that the laptop always gets the same IP address. See the documentation for your DHCP server for details.
__________________
Alex (http://www.alex-greg.com) |
|
#3
|
|||
|
|||
|
I think you misunderstood my question. I have 2 separate interfaces, each with a separate MAC address. If they were the same, that would certainly be the best way to go.
|
|
#4
|
||||
|
||||
|
Quote:
A port can only be forwarded to one address. You can change this address quite easily using iptables, though. |
|
#5
|
|||
|
|||
|
I think it *is* possible.
How are you managing your routing right now? To automatically switch to another interface once it comes available, you probably already have some kind of dynamic routing setup. It could work like this (untested): - setup a dummy interface on the router with an IP that is unused but on the same network as the router and your laptop. - make your services listen to the dummy IP address / forward the ports to this one (maybe forward again to the "real" destination then) - setup the dynamic routing to use either interface to connect to it (the dummy) Plz tell us your results.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#6
|
|||
|
|||
|
Quote:
That sounds like a quite sensible solution, M. I'm not entirely sure how to execute it, though. I would assume this dummy interface would be best set up using IP aliasing? Would you suggest making it an additional node on my existing 192.168.1.0 network, or setting it up as an additional network on 192.168.2.0? Also, how would you go about forwarding an already-forwarded port? As for routing, I'm at a pretty basic level. The auto-switching of the interfaces is done by Windows software on the laptop. It monitors the wired ethernet port for a connection & switches the wireless on or off as necessary. I really appreciate the time you've taken to think about this. |
|
#7
|
||||
|
||||
|
Quote:
Thinking about it again, a dummy interface is probably not of much help in your case. It is useful for using 2 nics, one at a time, but not for port forwarding. With my idea you would have needed a dummy interface on the laptop, not on the router. Instead you could use a extended version of "rinetd", this is a daemon that does something similar to port forwarding. Extended version because the rinetd that i know does not allow to say "if not available, use this instead" and can use TCP only. Using windows on the laptop is a big obstacle here. Because the longer I think about it, the more I get the feeling you have to do most of this on your laptop, not on the router... Quote:
I thought I had the idea with the dummy interface from the Linux High Availability Howto, but I just had a short glance at it and they are using another approach (with a heartbeat-ping every second to bring one interface down and another one up once the heartbeat does not go through anymore. This sounds similar to what you told about your windows software) Make a little test: - unplug the ethernet cable - ping the laptopīs ethernet cardīs IP from the router. Does it pong? (I tested with my linux router and it does. But my workstation has only one nic...) if yes - problem solved. if no, activate routing on the laptop. (donīt ask me how to do that on windows )Still no? - post back, Iīll think of a solution (other than "FORMAT C: /U" )Last edited by M.Hirsch : July 1st, 2003 at 12:28 PM. |
|
#8
|
|||
|
|||
|
Quote:
Should I get a response to the ping or no response? |
|
#9
|
|||
|
|||
|
I hope you do get a response. If the XP machine answers to requests to the Ethernet NICīs IP coming from the WLan NIC with the help of some internal routing, it should be working now.
|
|
#10
|
||||
|
||||
|
Um....... If your using both the wired nic and the wireless card on the same laptop, and if you arent going to be using them at the same time, why not just assign both cards the same *STATIC* ip address?
-Mr.K |
|
#11
|
|||
|
|||
|
I'd considered that & I might be stuck with it. I was trying to avoid any reconfiguration between running the laptop at home & at work.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Port forwarding dilemna |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|