D
D
Denis Sechin2017-03-11 11:25:59
System administration
Denis Sechin, 2017-03-11 11:25:59

How to write stat. route to the internal subnet?

There is a host machine 10.10.1.4. There is a virtual ubuntu-serv with two interfaces eth1 10.10.1.6 bridge with the host machine and eth0 192.168.1.0/24 internal subnet. I need to ping a host machine on the internal network behind ubuntu-server 192.168.1.2. From machine 192.168.1.2, machine 10.10.1.4 responds, but not vice versa, prescribed stat. route on 10.10.1.4


route add -net 192.168.1.0 netmask 255.255.255.0 gw 10.10.1.6

Did not help.
Here are the rules of the virtual machine:

LOCAL_IF=eth1
LOCAL_NET="192.168.1.0/24"
INET_IF=eth0
INET_NET="10.10.1.6"
# INPUT RULES
$ip -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$ip -A INPUT -i lo -j ACCEPT
$ip -A INPUT -p icmp -j ACCEPT
$ip -A INPUT -p tcp --dport 4491 -j ACCEPT
$ip -A INPUT -p udp --dport 53 -j ACCEPT
# FORWARD RULES
$ip - A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
$ip -A FORWARD -p icmp -j ACCEPT
# NAT PREROUTING
$ip -t nat -A PREROUTING -s $INET_IF -j MASQUERADE
# NAT POSTROUTING
$ip -t nat -A POSTROUTING -s $LOCAL_NET -j MASQUERADE

How to access from machine 10.10.1.4 to machine 192.168.1.2 which is behind router 10.10.1.6
968af13cf81a4b3eb469d92d56992f5c.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question