个人工具

UbuntuHelp:UbuntuLTSP/LaptopDemo

来自Ubuntu中文

跳转至: 导航, 搜索
This page is specific to Ubuntu versions 9.10

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


How to setup Laptop Demo

Here we do setup for laptop demo. We need working LTSP setup in laptop and ethernet crossover cable for thin client. Laptop as a LTSP server is connected to the Internet by WLAN, another laptop as a thin client is connected to the LTSP server by LAN (ethernet crossover cable). This way we can minimize needed hardware for demo session, we need just a laptop and ethernet crossover cable. Between WLAN (wlan0) and LAN (eth0) we need NAT. So our setup looks like this.

LAN (eth0) - Thin client
|
Laptop/LTSP server (NAT)
|
WLAN (wlan0) - Internet 

NAT between WLAN and LAN

Be sure that your laptop can access to the Internet by WLAN. And be also sure that your thin client, for example another laptop can boot by PXE and act as a thin client. Here we get dynamic ip address from WLAN AP. We use networkmanager applet for that.

wlan0     Link encap:Ethernet  HWaddr 00:1d:e0:67:09:a5  
          inet addr:192.168.0.105  Bcast:192.168.0.255  Mask:255.255.255.0

But we use static ip address for LAN.

eth0      Link encap:Ethernet  HWaddr 00:a0:d1:a3:81:55  
          inet addr:192.168.1.105  Bcast:192.168.1.255  Mask:255.255.255.0

Real magic is here in these two lines. Run them as root (sudo).

iptables -t nat -A  POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT

Permanent NAT setup

We can make this NAT setup permanent same way as in this howto. https://help.ubuntu.com/community/UbuntuLTSP/ThinClientHowtoNAT/ We create as root (sudo) file '/etc/network/wlan-nat.rules' after we have run those two commands above.

iptables-save > /etc/network/wlan-nat.rules

And we add that in file '/etc/network/interfaces' this way. This way we have NAT between WLAN and LAN in every boot.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
	address 192.168.1.105
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1
	dns-nameservers 192.168.1.1
	up iptables-restore < /etc/network/wlan-nat.rules

Now we are ready to start demo session about LTSP with laptop and ethernet crossover cable. Here is an example screenshot - iTalc works very well with this kind of setup. Edubuntu_Wlan_Lan_iTalc_01.png