Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /web/mp1/vlcek/martin/include/common.inc.php on line 140
|
|
Ubuntu: How to...... set up a simple firewall(thanks to http://townx.org/simple_firewall_for_ubuntu_using_iptables) Create a file /opt/scripts/firewall.script: #!/bin/bash
# flush all chains iptables -F # set the default policy for each of the pre-defined chains iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD DROP # allow establishment of connections initialised by my outgoing packets iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # HTTP server #iptables -A INPUT -p tcp -s 0/0 --dport 80 -j ACCEPT # SAMBA server (LAN only) #iptables -A INPUT -p udp -s 10.0.0.0/24 --dport 137 -j ACCEPT #iptables -A INPUT -p udp -s 10.0.0.0/24 --dport 138 -j ACCEPT #iptables -A INPUT -m state --state NEW -m tcp -p tcp -s 10.0.0.0/24 --dport 139 -j ACCEPT #iptables -A INPUT -m state --state NEW -m tcp -p tcp -s 10.0.0.0/24 --dport 445 -j ACCEPT # Synergy server (LAN only) #iptables -A INPUT -p tcp -s 10.0.0.0/24 --dport 24800 -j ACCEPT # drop everything else iptables -A INPUT -i eth+ -p udp -j DROP iptables -A INPUT -i eth+ -p tcp -m tcp --syn -j DROP # accept anything on localhost iptables -A INPUT -i lo -j ACCEPT and set it executable. Create /etc/init.d/firewall: #!/bin/bash
if [[ $1 == start ]] ; then /opt/scripts/firewall.script else iptables -F fi set it executable and setup "autostart" with: sudo update-rc.d firewall start 20 2 3 4 5 . stop 99 0 1 6 .
... share your Internet connectionSetup your computer, whose internet connection you want to share, e.g. with a fixed ip address of 192.168.0.1. Assuming your internal network card - connected to the other computers in your home net - is eth0, enter the following in a terminal: sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo apt-get install dnsmasq ipmasq /etc/init.d/dnsmasq restart Reconfigure ipmasq to start after networking (other options use defaults): dpkg-reconfigure ipmasq
Add the line "net.ipv4.ip_forward = 1" to /etc/sysctl.conf Setup your other computer(s) to use an ip address in the same network (e.g. 192.168.0.2, ...) and set your internet computer as gateway and DNS server. (see http://ubuntuforums.org/showthread.php?t=91370) ... share a folderJust try it and you will be prompted that the package samba has to be installed. However, sharing a folder on an NTFS drive does not really work - there seem to be problems with the rights, both when configuring the sharing and then when accessing the share. ... use one keyboard and mouse for two computersThis assumes a network connection between the computers. On both computers install the package synergy. On the server (i.e. the computer, whose keyboard and mouse you want to use), create a file ~/.synergy.conf: section: screens
server: client: end section: links server: left = client client: right = server end This assumes that the computer whose keyboard and mouse you want to use is named "server" and your other computer is named "client" and is located left of your server. Replace these with your computer names. On your server start synergy with synergys
On your client start synergy with synergyc server (replace "server" with the name of your server) When you now move your mouse in the direction of your other computer over the edge of the screen, it will appear on the other computer and all mouse and keyboard input will be redirected to this other computer. You can set up more than one computer and even use different OS on these computers (Linux, Windows, MacOS). ... connect to Internet with aonSpeed (1)
|