![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2004
Beans: 187
Ubuntu 9.10 Karmic Koala
|
This is supposed to help people who are running an ubuntu router and want to run an amule client behind it.
Note: The system this was done on was a woody debian router with ancient software (it still ran ipchains). I simply upgraded to warty by editing the /etc/apt/sources.list and installing ubuntu-base and upgrading everything else. clean reboot, and started configuring. (Read the next post for some really helpfull information!) Step1: getting started Install ubuntu on the router. (ubuntu base is sufficient, ubuntu desktop just contains a whole bunch of gui packets) If you have ipmasq on your Router - Uninstall it! Code:
/etc/init.d/ipmasq stop /etc/init.d/ipmasq-kmod stop apt-get remove ipmasq Setting up iptables for ip-masquerading and for amule port-forwarding (and ssh access from outside) (optional) enabling autosave of iptables: Code:
sudo gedit /etc/default/iptables Save and exit. note: This could be bad. If you screw something up and reboot your computer. Your mistakes will still be autosaved! Get a root shell: Code:
sudo bash Code:
ln -s /etc/init.d/iptables /etc/rcS.d/S41iptables Add this line to: /etc/init.d/iptables Code:
echo 1 > /proc/sys/net/ipv4/ip_forward Code:
case "$1" in
start|restart|reload|force-reload)
initd_load active
if test ${enable_autosave-false} = true; then
touch $autosave
Code:
case "$1" in
start|restart|reload|force-reload)
initd_load active
echo 1 > /proc/sys/net/ipv4/ip_forward
if test ${enable_autosave-false} = true; then
touch $autosave
Code:
iptables -F; iptables -t nat -F; iptables -t mangle -F iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT iptables -P INPUT DROP iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT (assuming the computer running amule has the ip "192.168.0.7") Code:
iptables -t nat -A PREROUTING -i ppp0 -p tcp --destination-port 4662 -j DNAT --to-destination 192.168.0.7:4662 iptables -t nat -A PREROUTING -i ppp0 -p udp --destination-port 4672 -j DNAT --to-destination 192.168.0.7:4672 iptables -t nat -A PREROUTING -i ppp0 -p udp --destination-port 4665 -j DNAT --to-destination 192.168.0.7:4665 Step3: Since you might want to still be able to login to your router via ssh from the outside, you will need to open the ssh port (22) Code:
iptables -A INPUT -p tcp --dport 22 -j ACCEPT Testing and saving everything: * Run amule and check if the "you have a low id" message is absent in the connected to server message. If it is: congratulations. If not - doh! * Try to login from somewhere outside your LAN via ssh(If you can) - That should work as well. * Run nmap from outside your lan on your router. It should not show any open ports (not even ssh). * If you are happy with it save your iptables: Code:
/etc/init.d/iptables save active Code:
iptables-save -c > ~/iptables_backup Code:
cat ~/iptables_backup | iptables-restore Reboot the router! (do not hit the reset button - reboot cleanly!) Last edited by t.rei; March 2nd, 2005 at 11:12 AM.. |
|
|
|
|
|
#2 | ||||
|
Dipped in Ubuntu
![]() |
Re: HOWTO: set up a (Ubuntu)Linux-router for amule
Quote:
Code:
apt-get --purge remove ipmasq Quote:
Code:
[~] > dpkg -l iptables ii iptables 1.2.11-10 Linux kernel 2.4+ iptables administration tools Quote:
Quote:
Code:
[~] > cat /etc/network/options ip_forward=yes spoofprotect=yes syncookies=yes
__________________
"Linux is like a wigwam. No Windows, no Gates and Apache inside!" - Unknown RFC 3092 - Etymology of "Foo" |
||||
|
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2004
Beans: 187
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: set up a (Ubuntu)Linux-router for amule
ah ok - thx for all those hints.
yes - I do have a little bit of a mixed system. I will check back with all your hints and fix the howto. thx for the detailed feedback. |
|
|
|
|
|
#4 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2004
Beans: 187
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: set up a (Ubuntu)Linux-router for amule
ok - i can confirm all of your statements. I will leave things as they are but paste lines mentioning the woody->warty upgrade @ first lines.
|
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: Jul 2007
Beans: 65
|
Re: HOWTO: set up a (Ubuntu)Linux-router for amule
Hi I am a newbie in ubuntu/linux. I am trying to setup my ubuntu 7.4 as router, but I am not sure where to start. I prefer not use any GUI. Therefore, I install webmin, but I seem lost in places how to enable the second NIC as DHCP to allow other pc (LAN) to connect. Please help.
__________________
Embrace Linux! |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|