Answer the question
In order to leave comments, you need to log in
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
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question