- Community Home
- >
- Networking
- >
- Switching and Routing
- >
- Comware Based
- >
- Re: Default route for specific VLAN
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 12:36 AM - edited 02-08-2021 12:40 AM
02-08-2021 12:36 AM - edited 02-08-2021 12:40 AM
Default route for specific VLAN
Hello,
is it possible to set a default route to the internet for a specific VLAN?
So I would like to use the IP 10.10.1.1 as the default gateway to the internet if the VLAN 10 Management IP 10.10.1.2 is used as the default gateway.
Default route: 0.0.0.0 0.0.0.0 10.10.0.1
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 12:44 AM
02-08-2021 12:44 AM
Re: Default route for specific VLAN
Hi @EarlGay !
I think the PBR (Policy-Based Routing) is the feature you are looking for. Only it can override routing table lookup and push the traffic to next-hop different from the one listed in the routing table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 01:09 AM
02-08-2021 01:09 AM
Re: Default route for specific VLAN
Hi,
thanks, it`s working, thank you!
One more question: is it still possible that the computers between both VLANs can communicate? All computers use the VLAN management IPs as default gateway but I can only ping the management IP on both sides.
Thank you for the input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 01:23 AM
02-08-2021 01:23 AM
Re: Default route for specific VLAN
If we still speak about 5130 switch, then IP routing is enabled by default and can't be disabled. When the communication between both PCs in different VLANs stopped - after applying PBR or it wasn't working even before PBR application?
It will help if you provide the following:
1. Configuration of both switch ports where those PCs are connected
2. 'display ip routing-table' output from the switch
3. Configuration of Vlan-interfaces of those both VLANs
4. 'ipconfig /all' (if PCs are running Windows) from both PCs (you can delete all information except IP address, subnet mask and default gateway)
5. 'route print' output from both PCs.
It is possible that your PCs have more that one active NIC, in this case default gateway of another adapter may have higher precedence and traffic may simply go out the wrong way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 01:28 AM - edited 02-08-2021 01:28 AM
02-08-2021 01:28 AM - edited 02-08-2021 01:28 AM
Re: Default route for specific VLAN
Hi, the connection stopped after the PBR has been activated which is correct I guess due to the gateway change. I need the PBR to take action after the VLAN routing which maybe is not possible? I guess a static route on the gateway itself will solve my problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 01:47 AM
02-08-2021 01:47 AM
Re: Default route for specific VLAN
Oh, I see, so it's because PBR intercepts all the traffic, even between VLANs. We need to add an exception to PBR to avoid that by creating two nodes in your PBR policy. First node will be, for example node 10 and will be deny node that will match the traffic between VLANs, second node, 'permit' node will match all the traffic. Because node 10 have higher preference, first PBR will check if the packet is inter-VLAN one and push it through the routing table. If the packet is not matched by node 10, then it will hit node 20 and will get to the desired next-hop.
Example:
you have two VLANS - VLAN 10 with subnet 10.0.10.0/24 and VLAN 20 with subnet 10.0.20.0/24. You want to forward all traffic to a next-hop 10.99.0.1, but traffic between VLANs 10 and 20 should be routed according the routing table, e.g. locally.
acl advanced 3000
rule 10 permit ip source 10.0.10.0 0.0.0.255 destination 10.0.20.0 0.0.0.255
rule 20 permit ip source 10.0.20.0 0.0.0.255 destination 10.0.10.0 0.0.0.255
#
acl advanced 3001
rule 10 permit ip
#
policy-based-route MyPBR deny node 10
if-match ACL 3000
#
policy-based-route MyPBR permit node 20
if-match ACL 3001
apply next-hop 10.99.0.1
#
interface Vlan-inteface10
ip policy-based-route MyPBR
#
interface Vlan-inteface20
ip policy-based-route MyPBR
It's just an example, but I think you got the idea - the 'deny' PBR node doesn't mean 'drop the traffic', it means 'exclude it from PBR process'. The rest is pretty straightforward.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 08:18 PM
02-08-2021 08:18 PM
Re: Default route for specific VLAN
thank you Ivan, I used your example and changed the network but it`s not working for VLAN 1 and 10, and also our DNS proxy stopped working after adding both VLANs to the PBR rule.
#
acl advanced 3000
rule 10 permit ip source 192.168.0.0 0.0.0.224 destination 10.10.1.0 0.0.0.255
rule 20 permit ip source 10.10.1.0 0.0.0.255 destination 192.168.0.0 0.0.0.224
#
acl advanced 3001
rule 10 permit ip
#
policy-based-route MyPBR deny node 10
if-match acl 3000
#
policy-based-route MyPBR permit node 20
if-match acl 3001
apply next-hop 10.10.1.1 direct
#
interface Vlan-interface1
ip address 192.168.0.2 255.255.224.0
ip policy-based-route MyPBR
#
interface Vlan-interface10
ip address 10.10.1.2 255.255.255.0
ip policy-based-route MyPBR
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 11:05 PM
02-08-2021 11:05 PM
Re: Default route for specific VLAN
The wildcard mask that matches VLAN 1 traffic is incorrect. The wildcard is the inverse netmask and since you have subnet mask 255.255.224.0 in VLAN 1, you need to modify ACL 3000 as follows:
acl advanced 3000
rule 10 permit ip source 192.168.0.0 0.0.31.255 destination 10.10.1.0 0.0.0.255
rule 20 permit ip source 10.10.1.0 0.0.0.255 destination 192.168.0.0 0.0.31.255
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 11:06 PM
02-08-2021 11:06 PM
Re: Default route for specific VLAN
ah well, ofc... I didn't see that, thanks