Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: Use Router W/ Linux Server & Windows Lan

Status
Not open for further replies.

sawysc01

ISP
Jul 26, 2003
6
US
I have read so much trying to grasp this and at this point I am totally confused can someone please try and break this down for me. What I am trying to do is this....

I am running a Linux Red Hat 8.0 Server connected to a Cisco UBR 900 Cable Modem with Static IP Address. I have the server working great with no problems. My eth0 card is bound to my static ip address and is required for my server control panel software.

I have 2 Windows XP Professional Machines that I need to get access to the Internet.

I have a Cable/DSl Router (LinkSys) and a seperate (Linksys) Hub.

Originally I had this layout ..

Cable/DSL Router WAN Internet port connected to the Cable Modem.

Linux Server connected to the Router Port and Both Windows Machine Connected to the router

I had the Router DHCP Enabled for the Windows XP Machine's and a dedicated IP to the Linux Machine. This configuration worked until I needed to have the server eth0 card bind to my static IP address. In the above configuration my control panel doesn't work because it knows it is connected to a 192.*.*.* number instead of a 24.*.*.* number.

So now I have the server connected straight to the modem and it works like it is suppose to, but I need to connect my 2 Windows XP computers to the net.

I would like someone to explain how to do this in straight forward terms if possible. I am sure there is a way to connect them through the router or through the hub with something ( crossover cable? perhaps) but I don't know what should connect where anymore.

Thank you for any help and direction you can provide
 
Try this....

Internet
|
|
Cisco cable modem
|
|
Linksys router
|
|
Linux and Windows PC's


Are you saying that your Linux box needs a static IP? Can it be any static IP, or does it have to be a public IP assigned from your ISP?


ChrisP
 
I would find a different "control panel". :) My opinion not withstanding, it sounds like your existing topology will work fine. I don't think your router would share the same ip without putting up a fight. You may however, put your server in the router's DMZ. I don't like this setup because you are bypassing the firewall. If you are in the market for a way to admin all your servers and system in general, check out it doesn't care what ip you give the server.
 
As everyone else stated, your original setup was fine. You just need to forward the appropriate port(s) for your 'control panel' from the router to your linux server. For example, the default port for webmin that RhythmAce mentions is 10000. Therefore, using this from the internet, would require that in the router setup, you forward port 10000 to the internal statiic IP of the linux server (192.168.1.x).
 
I was using the webmin control panel, but could not setup reseller hosting accounts so I switched to the DirectAdmin Control Panel at and the software will only work with my Public Static IP Of 24.56.*.* I can set this IP in the Router WAN Port... Wait a minute??

Question???

What if I change the static IP on eth0 from 24.56.*.*. to the static IP of 192.168.1.20 so it connects to the router. When I do it this way and go to say it returns with my correct static IP 24.56.*.* if I forward the http:FTP,mail, etc ports from the router to Linux server. Since my control panel is bound to the static IP 24.56.*.* it should be available from any browser anywhere, since the router is just forwarding the port request for 24.56.*.*:80 to 192.168.1.20:80

Does that make since??

Or is there away to do this using 2 NIC's one for the WAN and 1 to control the LAN?

I thank you for your assistance.
 
yes, just forward any ports you need to your Linux server, or just put the server in the DMZ so that everything is forwarded to it. If you put the server in the DMZ, security will be reduced, so only do this if you must.

Chris
 
This is what I have done but I don't know if it's correct. I have left my eth0 card with my public static IP address.

I added a 2nd NIC eth1 and connected it to the router and gave it a static IP of 192.168.1.20

I connected eth0 to the router.

I connected the router to the cable modem.

I set the router to forward all ftp,email,http to 192.168.1.20

This connection is working at the moment and I can access my DirectAdmin Control panel, but what purpase is eth0 serving now, I don't get it.


I did try changing back to my original config mentioned earlier with the one NIC set to 192.168.1.20 and connected to the router this would not work only gave a connection refused error.

Since the coniguration I have is working is this just a fluke or am I close to getting it.

You have all been a great help and I thank you for pointing me in the right directions
 
You don't need 2 NICs in the Linux box. Plug eth0 into the hub/switch and configure it with a static IP of 192.168.1.20.

Remember to configure you default gateway to the internal IP of your router.

route add default gw 192.168.1.1

Chris
 
fluid11

I tried the config you suggested and yes I can connect all computers to the web but my domain name now defaults to a blank test/ssl page not to my domain index page.

I have tried putting it on the DMZ zone and tried forwarding port 2222 and enabled it. My control panel is reached by port 2222 but it says "connection refused"

I can access my webmail with the domain name but not the control panel to service the domain nor can I access the control panel my the IP address
Being on the DMZ every request should be forwarded to the server but doesn't apparently. Should I just get an additional IP address and use one for the LAN and one for the Server
 
Is there away to add 2 IP addresses to the one eth0 card?

I see in the Network Configuration menu of Red Hat that if you select the card and click configure and then edit it has a General/Route/Hardware Device Menu

In the General Tab

192.168.1.20 (IP)
255.255.255.0 (Subnet)
192.168.1.1 (Gateway)

In the Route Tab Is the same information

And in the Hardware Device it asks for Device Alias and Bind to Mac Address settings. Do these need to be changed

According to DirectAdmin in there e-mail they say that if my ifconfig file does not show the Static Public IP bound to the eth0 card it will not work





 
I'm not sure this will take care of things but what you are talking about is ip aliasing. This is where you have virtual interfaces, i.e. eth0, eth0:1, etho:2 and so on. If you don't want to have to redo this everytime you reboot, you can put this in /etc/rc.d/rc.local.

First setup the ip aliases:

/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 24.56.*.* (your public ip)
/sbin/ifconfig eth0:0 192.168.0.10 (these can be any private ip)
/sbin/ifconfig eth0:1 192.168.0.100 (you can go up to 255)

Now setup the routes:

/sbin/route add -net 127.0.0.0
/sbin/route add -net 24.56.*.* dev eth0
/sbin/route add -host 192.168.0.10 dev eth0:0
/sbin/route add -host 192.168.0.100 dev eth0:1
/sbin/route add default gw 192.168.0.1 (your router's lan ip)

You can reenter these on the command line or reboot. You can also assign host names to each of these aliases just as you did etho.


 
Rhythm User
fluid11

Thanks for the help with this issue, my config now works properly and I thank you again.

I do have one last issue. I have 5 static IP's assigned to my account and I know that each new server I connect I can assign them 1 ip address. But is there away to assign 2 Public Ips to the same server for example.

I want 2 nameservers 24.56.*.1 and 24.56*.2 but the DNS server is on 24.56.*.1

Thanks again
 
You don't need a second IP to add that third nameserver. As long as your default gateway is configured, you can access any computer on the Internet.

If you do want to assign an additional IP address to your server for some reason, you can do this using IP aliasing, as mentioned above. Since your using that Linksys router, assigning a public IP to a computer behind the router won't do anything because those computers are on the 192.168.1.x subnet. If you need additional public IPs, you'll have to assign them to the external interface of the router, which I don't think is possible with the Linksys. You'll probably need a better router/firewall for this purpose. A Cisco PIX 501 would do the trick.

ChrisP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top