I have many devices manually configured which i don't want to change. Is there any other better way. Why static route won' t work?
Network one - 10.10.10.0/24
Network two - 10.10.20.0/24
odintsov
U can show this command output from both devices?
ip route show
ittechlab
ASKER
[root@smtp ~]# ifconfig eth0 | grep inet
inet addr:10.10.10.37 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe09:8750/64 Scope:Link
[root@smtp ~]# ip route show
10.10.20.0/24 via 10.10.10.6 dev eth0
10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.37
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
169.254.0.0/16 dev eth0 scope link metric 1002
[root@ns ~]# ifconfig eth0 | grep inet
inet addr:10.10.20.4 Bcast:10.10.20.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:febb:a670/64 Scope:Link
[root@ns ~]# ifconfig eth2 | grep inet
inet addr:10.10.10.6 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:febb:a684/64 Scope:Link
[root@ns ~]# ip route show
10.10.20.0/24 dev eth0 proto kernel scope link src 10.10.20.4
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.18
10.10.10.0/24 dev eth2 proto kernel scope link src 10.10.10.6
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
169.254.0.0/16 dev eth2 scope link metric 1004
default via 192.168.0.254 dev eth1
[root@mail ~]# ifconfig eth0 | grep inet
inet addr:10.10.20.2 Bcast:10.10.20.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feaf:56f7/64 Scope:Link
[root@mail ~]# ip route show
10.10.20.0/24 dev eth0 proto kernel scope link src 10.10.20.2
10.10.10.0/24 via 10.10.20.4 dev eth0
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
169.254.0.0/16 dev eth0 scope link metric 1002
default via 10.10.20.1 dev eth0
I want able to ping from 10.10.10.37 to 10.10.20.2 AND
from 10.20.10.2 to 10.10.10.37 vice versa.
I am using ns system as router which have access to both network.
All routing configuration fine (mail: 10.10.10.0/24 via 10.10.20.4 smtp: 10.10.20.0/24 via 10.10.10.6).
May u need enable forwarding on ns node:
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
Can u see forwarded packet in iptables (iptables -nvL FORWARD)?
ittechlab
ASKER
route add -net 10.10.20.0 netmask 255.255.255.0 gw 10.10.10.6 dev eth0
How do i make this permanent.
odintsov
Hello,
U need create files: /etc/sysconfig/network-scripts/route-eth0 on both servers with following contents:
10.10.20.0/24 via 10.10.10.6 dev eth0
and
10.10.10.0/24 via 10.10.20.4 dev eth0
route add -net 10.10.20.0 netmask 255.255.255.0 gw 10.10.10.6 dev eth0
still not working. what is wrong here.