need help with routing to firewall only from vlans
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
need help with routing to firewall only from vlans
I am working on a project that deals with a hotel/condo so we are working with VLAN tagging, a switch and CentOS. Our goal is to route traffic from VLAN100 and VLAN101 to the firewall only which of course is the internet. We don't want VLAN101 to route to anything else on VLAN1, just the firewall. We don't want VLAN100 and VLAN101 to pass traffic to each other as those would be the different offices. There will eventually 50 VLANs between 3 switches; 1 switch per floor.
IP forwarding is OFF in sysctl.sys so we accomplished the goal of not passing traffic between the VLAN. We can ping from VLAN101 the CentOS ETH0 and ETH0.101 interface. And of course nothing passes between anything else.
My question, what route add or ip route or ip rule do we add in CentOS that would meet our goal of just reaching the firewall and nothing else on VLAN1 from the other VLANs?
Thanks in advance.
-Bryan
VLAN101 <<--->> Firewall only
VLAN102 <<--->> Firewall only
VLAN101 //---// VLAN102
VLAN1 is 192.168.1.0 (port 23/24 trunk on the switch)
VLAN101 is 192.168.50.0 (port 1 on the switch)
VLAN102 is 192.168 51.0 (port 2 on the switch)
The firewall is on 192.168.1.254. There is a route on the firewall 192.168.50.0 to 192.168.1.240.
CentOS interfaces
ETH0 is on 192.168.1.240.
ETH0.101 is 192.168.50.1
ETH0.102 is 192.168.51.1
be careful not to think vlans are more than they actually are. Inside your system, ignore vlans. You have some interfaces which will tag traffic leaving it with 802.1q headers, but that's irrelevant to the internals of your system.
Routing is not to restrict anything, but enable it. You would enable routing generically (which would be enabling ip_foward and probably no actual route changes at all as everything is local to the box, so implicitly routed) and then filter traffic flows you do not wish to permit using iptables.
Thanks. That is what I suspected and you have confirmed it. I am now using iptables. I'll create another topic for the iptable statement that is throwing me off.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.