1

The picture that i add bellow is a network that i have. enter image description here I am going to manage tables of host0 and host1. The commands that i wrote has error, even i wish some help to understand why do i receive these errors. In addition, I am not sure the commands that i am using are correct. I would greatly appreciate if you can guide me.

For Host0:

ip -f inet addr add 7.0.0.2/8 dev sim0 
ip link set sim0 up arp off 
ip -f inet addr add 10.1.0.1/24 dev sim1 
ip link set sim1 up arp on 

ip route add 10.2.0.1/24 via 7.0.0.1 dev sim0 
                     RTNETLINK answers: No such file or directory
ip route add 10.2.1.1/24 via 10.1.0.2 dev sim1  
                     RTNETLINK answers: No such file or directory

ip route show               
             7.0.0.0/8 dev sim0  proto kernel  scope link  src 7.0.0.2 
          10.1.0.0/24 dev sim1  proto kernel  scope link  src 10.1.0.1 

For Host1:

ip -f inet addr add 10.2.0.1/24 dev sim0 
ip link set sim0 up arp off 
ip -f inet addr add 10.2.1.1/24 dev sim1 
ip link set sim1 up arp off 


ip route add 7.0.0.2/8 via 10.2.0.2 dev sim0        
                              RTNETLINK answers: No such file or directory
ip route add 10.1.0.1/24 via 10.2.1.2 dev sim1 
                            RTNETLINK answers: No such file or directory


ip route show               
          10.2.0.0/24 dev sim0  proto kernel  scope link  src 10.2.0.1 
        10.2.1.0/24 dev sim1  proto kernel  scope link  src 10.2.1.1 

1 Answer 1

0

How about ip route add 10.2.0.0/24 via 7.0.0.1 dev sim0 or ip route add 10.2.0.1/32 via 7.0.0.1 dev sim0 for Host0?

EDIT: It seems that if the routing target is host/network form, no extra bit should be set. For example, when '/24' is supplied 4th octet should be zero, when '10.2.0.1' is supplied '/32' should be supplied regardless of target host's netmask.

2
  • ip route add 10.2.0.0/24 via 7.0.0.1 dev sim0 worked and i could transfer packets from host0 to host 1 via lte, Thanks. But, how can i understand what i have to write for other route of host0 and host1? Could u please guide me.
    – samira
    Apr 18, 2017 at 21:07
  • I did the same as you told for others and now all paths are working. Thanks a lot
    – samira
    Apr 18, 2017 at 21:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .