What's new

External IP through Switch with VLAN

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Monnier

New Around Here
Hi,

I have a question I would like some suggestions on how to solve.

I'm trying to set up a live test environment to offer clients a backup solution.

This is my current setup:
WAN Fibre converter(with up to 5 external IP) -> Router/DHCP -> Linksys LGS552P -> Lan Devices

This is what I would like to add:

I have a server on port 41 that I would like to have an external IP.
In my head I would like to set Port 40-41 to an isolated VLAN (lets say #100)
Then I would connect the WAN to port 40 and the server is connected to port 41

Now they are isolated from the LAN. How do I give the server on port 41 the external IP from port 40?

Thanks for all the help I can get.
 
Last edited:
When you say port you mean the switch port? You cannot assign IPs from a switch because switches only handle the logical layer of your network, basically Layer 2 with Layer 3 detection but while they can read layer 3 features they cannot change or manipulate layer 3. You need a router configured to hand out those IP addresses and create the routes required.

For vlans you can use the 801.2Q based vlan or port based vlan. Assuming it is managed all you have to do is set port 40 and 41 to be a member of vlan 100 and set it to be untagged. Set your router to give the external IP address you want to the server by setting it from its DHCP server to always give your server (perhaps by mac address?) a particular IP address and the subnet of 255.255.255.255 and its gateway needs to be that of your router. I hope you understand subnets too and im assuming port 40 connects to router.
 
Thank you for your answer.

My WAN is a fibre converter with 8 ports.
When saying port I mean one of the ports on the switch. It's managed.

My Router can only handle one external IP så I was hoping there was a way to connect port 40 to the WAN and somehow forward everything to Port 41 so that it would be as if the server connected to port 41 was connected directly to the WAN but I maintain the logging/traffic managing in the switch.

The goal would be to give the server the external IP assigned from the WAN.
 
I am out of town right now but if your router can only handle one WAN IP address then your options are to add more routers or a switch with the first 5 devices getting WAN IP addresses. If you use a switch and plug in a server then it will get an outside WAN IP address with no firewall support except what's running on the server. You can create a VLAN on the switch but I am not sure it would help. Maybe you should look at routers which handle 5 WAN IP addresses.
 
Not so true, a router can handle multiple WANs if you create a routed layer 3 network which is basically what the internet uses. What you can do is create a route and gateway for your router and server as its own thing.
Heres how your router's routing will look like
Source Destination Gateway
0.0.0.0/0 public ip Router public IP
LAN 0.0.0.0/0 Router LAN IP
public ip 0.0.0.0/0 Router public IP
Make sure not to NAT traffic between the server and anything else but between LAN and anything else should be NATed like normal. The L3 network between your server and everything else is a normal Layer 3 routed network.
You run a dhcp server on the interface that your server connects to your router to assign its public ip (make sure you find out your network mask for it too). Your DHCP server can give out the public ip to the server, all you have to do is make that assignment static.

If you cant do this on your router you may need a better one.
 
Not so true, a router can handle multiple WANs if you create a routed layer 3 network which is basically what the internet uses. What you can do is create a route and gateway for your router and server as its own thing.
Heres how your router's routing will look like
Source Destination Gateway
0.0.0.0/0 public ip Router public IP
LAN 0.0.0.0/0 Router LAN IP
public ip 0.0.0.0/0 Router public IP
Make sure not to NAT traffic between the server and anything else but between LAN and anything else should be NATed like normal. The L3 network between your server and everything else is a normal Layer 3 routed network.
You run a dhcp server on the interface that your server connects to your router to assign its public ip (make sure you find out your network mask for it too). Your DHCP server can give out the public ip to the server, all you have to do is make that assignment static.

If you cant do this on your router you may need a better one.

Yes a routed network can carry multiple IP networks. The thing you should not be doing is running someone else's registered IP networks. Most people on this site with more than one outside IP address have 5 static IP addresses which all are in the same network so a routed network will not help you. If you can come up with outside public registered IP addresses that belong to different networks then routing will help you. Remember for each network you need an network IP address, a broadcast IP address and the general assigned IP addresses.
 
Thanks again for all the answers.

It sounds to me that buying a small firewall is the easiest solution.

WAN Port 1 -> Router/DHCP (External IP 1) -> Switch/LAN (Internal IPs)
WAN Port 2 -> Firewall -> Server (external IP 2)

Or am I missing something?
 
Yeah, a firewall would work for what you want. I've used Checkpoint in this manner in the past.
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top