Basically I am trying to create a custom TCP Stack. As you might know I cant use eth0 because linux kernel TCP stack uses that, Due to that I need to create a tun/tap interface and use it for my Custom TCP Stack.
iface lo inet loopback
iface eth0 inet static
iface tap0 inet manual
pre-up ip tuntap add tap0 mode tap user root
pre-up ip addr add 192.168.1.153/24 dev tap0
up ip link set dev tap0 up
post-up ip route del 192.168.1.0/24 dev tap0
post-up ip route add 192.168.1.152/32 dev tap0
post-down ip link del dev tap0
inet addr:192.168.1.152 bcast:192.168.1.255 netmask 255.255.255.0
inet addr:127.0.0.1 mask 255.0.0.0
inet addr: 192.168.1.153 bcast:0.0.0.0 mask 255.255.255.0
with following config I can reach wan/lan using eth0 but I cant reach not even my gateway with tap0.
I would really appreciate if you could tell me what mistake am I making here?