From 52a1fa090067c1b25d205d7a7ebd442fe071f843 Mon Sep 17 00:00:00 2001 From: "ds8283@student.uni-lj.si" Date: Tue, 13 Jan 2015 21:13:18 +0000 Subject: Spet ni commitalo howtoja ker ga nisem svn add-al. Upajmo da tokrat bo git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@181 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/nat_vlc/howtos/en/index.html | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 kpov_judge/tasks/nat_vlc/howtos/en/index.html diff --git a/kpov_judge/tasks/nat_vlc/howtos/en/index.html b/kpov_judge/tasks/nat_vlc/howtos/en/index.html new file mode 100644 index 0000000..76507f4 --- /dev/null +++ b/kpov_judge/tasks/nat_vlc/howtos/en/index.html @@ -0,0 +1,72 @@ + + + + + + + +

NAT VLC:

+

Explanation:


+ Set up a computer so that it forwards all packets meant for a certain address, to another computer.

+

Instructions:

+

1. Create two VMs. SimpleArbiter using the disk simpleArbiter and NATServer.

+ You can get the disks at polz.si/media/uploads/kpov/virtualke. As for the NATServer VM, you can use any disk you want like base-student-desktop-2014. +
+

2. NATServer should have two network interfaces. One should connect to the simpleArbiter VM and the other to the internet.

+ Adapter 1 should be NAt and adapter 2 should be Internal Network.
+ Simple Arbiter must be connected to the Internal Network. +
+ slika-1 +

3.On NATServer use ifconfig or /etc/network/interfaces to configure the network interfaces you created in virtualbox.

+ + -vim /etc/network/interfaces
+ -Set it up like this:
+ auto eth1
+ iface eth1 inet static
+ NETMASK 255.255.0.0 # Specify based on your requirement
+ IPADDR 192.168.2.1 # Gateway of the LAN
+ NETWORK 192.168.0.0 # Optional
+ ADDRESS 192.168.0.0
+ -ifdown eth1
+ -ifup eth1 +
+slika-2 +

4. Configure SimpleArbiter so that it uses NATServer as the default gateway.

+ +

5. Set up DNS (etc/resolv.conf) on NATServer.

+ vim /etc/resolv.conf + nameserver 203.145.184.13 # Primary DNS Server provided by the ISP
+ nameserver 202.56.250.5 # Secondary DNS Server provided by the ISP
+ Than we set up the host:
+ vim /etc/hosts
+ Replace the first line with:
+ 127.0.0.1 nat localhost.localdomain localhost
+ +

6. Enable IP forwarding on NATServerju (should be run as root).

+ echo 1 > /proc/sys/net/ipv4/ip_forward + +

7. Set up NAT on NATServer using iptables.

+ + apt-get install iptables
+ iptables -F
+ ptables -t nat -F
+ iptables -t mangle -F
+ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
+ iptables -A FORWARD -i eth1 -j ACCEPT

+ + service iptables restart + +

8. Use vlc on simpleArbiter to watch the video over your network.


+ + +

8. Additional resources


+-https://www.howtoforge.com/nat_iptables
+-http://www.bctes.com/nat-linux-iptables.html
+ + + + + + + + -- cgit v1.2.1