1

I have 4 virtual machines using virtual box. One virtual machine work as a router that connects 3 networks. Im trying to drop all communications entering the router machine, excpet for some services. The interfaces ips that I have in each machine are:

Virtual machine 1 that work as router:

eth1: 193.136.200.254 
eth2: 10.10.0.254 
eth3: 10.254.0.254 

Virtual machine 2:

eth1: 10.10.0.2 
eth2: 10.10.0.3 

Virtual machine 3:

eth1: 193.136.200.2 

Virtual machine 4:

eth1: 10.254.0.1

I define the rules below on the router machine:

IPTABLES -P INPUT DROP
iptables -A INPUT -s 193.136.200.3 -d 193.136.200.254 -p udp -m udp --sport 53 -j ACCEPT

And now Im trying to test if this is working using netcat. So in the router machine Im running the command:

nc -u -s 193.136.200.254 -p 53 193.136.200.3 53

And in thevirtual machine 3 Im running:

nc -u 193.136.200.3 53

Then I write a random word in one machine but it is not appearing in the other machine. So it isnt working. Do you know what is wrong?

Ozzy
  • 15
  • 4

1 Answers1

0

It's because you are connectiong itself, when you type the command:

nc -u 193.136.200.3 53

If you want to connect to your router from machine 3 try this command:

  1. nc -u -s 193.136.200.3 -p 53 193.136.200.254 53 instead of nc -u 193.136.200.3 53
Roid
  • 184
  • 7
  • Thanks. With your solution when i run the command it appears: nc: bind failed: cannot assign request address. – Ozzy Apr 24 '17 at 14:29
  • If I change 193.136.200.3 to 193.136.200.2 I dont get this error but when I write someting I get nc: write error: connection refused. – Ozzy Apr 24 '17 at 14:32