We need at least one Layer 2 based IP added to the server for two purposes:
1- Access to default gateway
2- Add a static route to the router (default gateway) for the layer 3 based IP addition
2- Add a static route to the router (default gateway) for the layer 3 based IP addition
We add the IP 172.16.10.33/24 as layer 2 based which means there is a default gateway (172.16.10.1) on the same subnet and broadcast domain
It is very important to choose the subnet mask properly so the default gateway is in the same subnet.
It is very important to choose the subnet mask properly so the default gateway is in the same subnet.
We add the default gateway to the sever:
Linux# ip route add 0.0.0.0/0 via 172.16.10.1 dev eth0
And add the static route for the layer 3 based subnet to the router
Vyatta# set protocols static route 192.168.20.0/24 next-hop ‘172.16.10.33’
The IPs on the server would be as following:
# ip addr
inet 172.16.10.33/24 brd 172.16.10.255 scope global eth0
inet 192.168.20.11/32 scope global eth0
inet 192.168.20.12/32 scope global eth0
inet 192.168.20.13/32 scope global eth0
Notice that layer 3 based IPs are added with prefix length /32 as they don’t need broadcast and ARP in order to work, as opposed to layer 2 based IPs that need broadcast and ARP and therefore subnet mask is important.