I have multiple vlans on the same network on the switch , how can I configure the IP address for every sub-interface to connect to the router I can't do that it causes overlapping .. what is the solution ?
The first thing you need to understand is that VLANs are an Ethernet concept. The switch doesn't care too much what kind of higher level traffic is flowing over them.
The second thing you need to understand is that switches have very limited IP functionality. Many only support IP for management purposes, those that do support IP routing usuaully only have very basic routing functionality.
The third thing you need to understand is that overlapping IP blocks are a massive pain in the arse. If you can eliminate them you should do so.
Ok with all that in mind you have overlapping subnets and you can't get rid of them. What to do.
The first thing you need to do is look at the big picture. Figure out what the network looks like. Figure out what your goals are.
- Do systems on the different networks need to talk to each other or are you just trying to arrange Internet access.
- The subnets overlap but do the host addresses actually clash?
Once you have a picture of what you have and what you need you can start looking for solutions.
If you have overlapping subnets and/or identical default gateways on multiple networks but you don't actually have overlapping host addresses I would look to use a single instance solution on a sufficiently flexible routing platform. Linux will let you assign the same address on multiple interfaces and you can then add /32 routes to send each IP address to the desired interface. If you want hosts on the overlapping subnets to talk to each other you can use proxy arp.
If you do have overlapping host addresses then you probably want to use a solution involving multiple independent instances of the IP stack. Linux calls these instances "network namespaces", the big name router vendors call them "vrfs". Each network can be terminated on it's own instance of the IP stack and then NAT rules applied as neede to translate things to a non-overlapping IP space.
It's not feasible to configure multiple Vlans with same network subnets . If there are in process of inter-Vlan routing ip address on Vlan will get overlapped .
To overcome this issue configure different network address for each Vlan.
When sub-interfaces are created in router it means we are creating multiples L3 interface . When L3 interfàce are created ideally should be on different networks to avoid conflict or overlapping.