I'm trying to add *secondary* subnet, a /22 in Ubuntu 16 but the IPs don't ping despite proper routing at the switch level. How do I properly bind the secondary /22 subnet (IPv4) and have these IPs ping?
I can ping locally, but not from external. Below commands didn't work.
root@server:~# iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
root@server:~# iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
Routing at the Cisco switch level is fine too:
interface Vlan100
description Server xxx
ip address xxx.xxx.16.1 255.255.252.0 secondary
ip address xxx.xxx.105.41 255.255.255.248
/etc/network/interfaces shows something like this...
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eno1
iface eno1 inet static
address xxx.xxx.105.42
netmask 255.255.255.248
network xxx.xxx.105.40
broadcast xxx.xxx.105.47
gateway xxx.xxx.105.41
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8 8.8.4.4
dns-search mydomain.com
iface eno1 inet static
address XXX.XXX.16.0/22
root@server:~# ifconfig |more
eno1 Link encap:Ethernet HWaddr d4:be:d9:ed:fb:8a
inet addr:xxx.xxx.xxx.42 Bcast:xxx.xxx.xxx.47 Mask:255.255.255.248
inet6 addr: fe80::d6be:d9ff:feed:fb8a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7386 errors:0 dropped:0 overruns:0 frame:0
TX packets:457 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:478778 (478.7 KB) TX bytes:467117 (467.1 KB)
eno1:0 Link encap:Ethernet HWaddr d4:be:d9:ed:fb:8a
inet addr:xxx.xxx.16.1 Bcast:xxx.xxx.19.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1