Route Xbox through a Linux-PC with 2 Network-Cards
As I didn't get my windows to route through my X-Box to the Internet i tried Linux.
Do all this at your own risk!
I used Kanotix for many reasons:
1) it's a live Linux, and it doesn't change anything on a system if you run it from CD, so i can take it everywhere. It usually autoconfigures everything, you won't have to do anything but to start it from CD
2) it can be installed easily in minutes
3) it's got a lot of configuration-scripts etc. on board
4) it's free
So let's tell you something about my Setup:
1 PC running Kanotix with 2 Network Cards - 1 connected to the Internet through a cable modem, the 2nd connected to the X-box with a twisted-patch-cable.
1 Xbox running Xebian (i guess this will also work with Xbox-Media-center...)
Ok - now let's first configure the Kanotix-PC
first find out, which device is connected to the internet:
(to get root-rights on live-Kanotix do sudo su)
ok - as 213.xxx.yyy.zzz is my ip, eth1 must be the network-adapter connected to the net, so eth0 must be connected to the xbox
let's set it up:
use netcardconfig (in the menu Kanotix>Networking/Internet>configure network adapter)
choose your network adapter (the one connected to the xbox), then choose no (= manual configuration)
ip:192.168.0.1
Netmask: 255.255.255.0
Broadcast:192.168.0.255
and blank out Nameserver and Gateway
now ping www.google.com to check if your internet is still up, if not, run netcardconfig again for your internet-network-adapter and choose automatic (DHCP)
now set up the router: i used this script (from http://wiki.kanotix.net/CoMa.php?CoMa=PrivatesNetzwerkMitRouter )
remove the # in front of your network device connected to the internet (mine is eth1) and save it as /usr/local/S90router.sh (as root)
then do
and start up the router it with
if you have installed Kanotix on your hd, you might want to run it everytime you run kanotix:
now i ssh'd into my xbox-Linux
(default for Xebian 1.10 - default pw for root is xebian)
and test if the routing works:
if it doesn't work restart network:
(this will of course cut your ssh session so start a new one)
ping again.
it should work now.
Happy networking
Thanx!!!!!!!!!
to Kano for the best Linux ever!
and to DarkTiger, RoEn, RanETo, SheVegen & BlueLupo for their Wiki-Howto @ http://wiki.kanotix.net/CoMa.php?CoMa=PrivatesNetzwerkMitRouter
Copyrights may be reserved by the original autors, Rights of this document: CreativeCommons - NonCommercial
Do all this at your own risk!
I used Kanotix for many reasons:
1) it's a live Linux, and it doesn't change anything on a system if you run it from CD, so i can take it everywhere. It usually autoconfigures everything, you won't have to do anything but to start it from CD
2) it can be installed easily in minutes
3) it's got a lot of configuration-scripts etc. on board
4) it's free
So let's tell you something about my Setup:
1 PC running Kanotix with 2 Network Cards - 1 connected to the Internet through a cable modem, the 2nd connected to the X-box with a twisted-patch-cable.
1 Xbox running Xebian (i guess this will also work with Xbox-Media-center...)
Ok - now let's first configure the Kanotix-PC
first find out, which device is connected to the internet:
(to get root-rights on live-Kanotix do sudo su)
root@Kanotix:# ifconfig
eth1 Protokoll:Ethernet Hardware Adresse 00:01:02:22:9D:F4
inet Adresse:213.xx.yy.zzz Bcast:213.xx.yy.255 Maske:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:111479 errors:0 dropped:0 overruns:0 frame:0
TX packets:10291 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:28340584 (27.0 MiB) TX bytes:781011 (762.7 KiB)
Interrupt:10 Basisadresse:0xec00
lo Protokoll:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX bytes:2588 (2.5 KiB) TX bytes:2588 (2.5 KiB)
ok - as 213.xxx.yyy.zzz is my ip, eth1 must be the network-adapter connected to the net, so eth0 must be connected to the xbox
let's set it up:
use netcardconfig (in the menu Kanotix>Networking/Internet>configure network adapter)
choose your network adapter (the one connected to the xbox), then choose no (= manual configuration)
ip:192.168.0.1
Netmask: 255.255.255.0
Broadcast:192.168.0.255
and blank out Nameserver and Gateway
now ping www.google.com to check if your internet is still up, if not, run netcardconfig again for your internet-network-adapter and choose automatic (DHCP)
now set up the router: i used this script (from http://wiki.kanotix.net/CoMa.php?CoMa=PrivatesNetzwerkMitRouter )
#!/bin/sh
#
# router.sh Dieses Startupskript startet einfache Routingtabellen.
# Es werden keine Firewall-Regeln implementiert.
#
# Autoren: RanETo, BlueLupo und DarkTiger vom KanotixWiki
#
# Version: 0.2 2005-03-12
#
# WICHTIG! Damit das Skript richtig funktioniert, muss zuerst eine der
# folgenden Zeilen entkommentiert werden. Und zwar genau die,
# die Schnittstelle definiert, mit der der Router mit dem
# Internet verbunden ist.
#
# INTERNET=ppp0 # Modem oder DSL-Karte
# INTERNET=ippp0 # ISDN
# INTERNET=eth0 # DSL über PPPoE (Netzwerkkarte -> DSL-Modem)
# INTERNET=eth1 # DSL über PPPoE (wenn "eth0" nicht funktioniert)
# INTERNET=wlan0 # WLan-Karte
NAME=router.sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PROGRAMM=$(which iptables)
PIDDATEI=/var/run/$NAME.pid
SKRIPTNAME=/etc/init.d/$NAME
if [ -z $INTERNET ]
then
echo "$NAME: Die Internetschnittstelle wurde noch nicht definiert!" >&2
echo " Bitte entkommentieren Sie die richtige Zeile!" >&2
exit 0
fi
if [ ! -x $PROGRAMM ]
then
echo "$NAME: Das Programm '$PROGRAMM' zur Steuerung des Routers ist nicht vorhanden!" >&2
exit 0
fi
router_start() {
echo "1" > /proc/sys/net/ipv4/ip_forward
$PROGRAMM --table filter --policy FORWARD ACCEPT
$PROGRAMM --table nat --append POSTROUTING --out-interface $INTERNET --jump MASQUERADE
}
router_stop() {
echo "0" > /proc/sys/net/ipv4/ip_forward
$PROGRAMM --table filter --policy FORWARD ACCEPT
$PROGRAMM --table nat --flush POSTROUTING
}
router_status() {
for TABELLE in filter nat mangle
do
echo "Tabelle \"$TABELLE\""
$PROGRAMM --table $TABELLE --list
echo
done
}
case "$1" in
start)
echo -n "$NAME: starte Routing ..."
router_start
echo " fertig"
;;
stop)
echo -n "$NAME: beende Routing ..."
router_stop
echo " fertig"
;;
restart|force-reload)
echo -n "$NAME: starte Routing neu ..."
router_stop
router_start
echo " fertig"
;;
status)
router_status
;;
*)
echo "Aufruf: $SKRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
remove the # in front of your network device connected to the internet (mine is eth1) and save it as /usr/local/S90router.sh (as root)
then do
root@Kanotix:# chmod u+x /usr/local/bin/S90router.sh
and start up the router it with
root@Kanotix:# /usr/local/bin/S90router.sh start
if you have installed Kanotix on your hd, you might want to run it everytime you run kanotix:
ln -s /usr/local/S90router.sh /etc/rc5.d/S90router.sh
now i ssh'd into my xbox-Linux
root@Kanotix:#ssh root@192.168.0.10
(default for Xebian 1.10 - default pw for root is xebian)
and test if the routing works:
xebian:~# ping www.google.de
PING www.l.google.com (216.239.59.147) 56(84) bytes of data.
64 bytes from 216.239.59.147: icmp_seq=1 ttl=238 time=82.9 ms
64 bytes from 216.239.59.147: icmp_seq=2 ttl=238 time=86.5 ms
64 bytes from 216.239.59.147: icmp_seq=3 ttl=238 time=74.0 ms
64 bytes from 216.239.59.147: icmp_seq=4 ttl=238 time=87.1 ms
64 bytes from 216.239.59.147: icmp_seq=5 ttl=238 time=84.6 ms
64 bytes from 216.239.59.147: icmp_seq=6 ttl=238 time=76.0 ms
64 bytes from 216.239.59.147: icmp_seq=7 ttl=238 time=78.7 ms
64 bytes from 216.239.59.147: icmp_seq=8 ttl=238 time=74.9 ms
64 bytes from 216.239.59.147: icmp_seq=9 ttl=238 time=78.9 ms
--- www.l.google.com ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8082ms
rtt min/avg/max/mdev = 74.042/80.427/87.123/4.727 ms
if it doesn't work restart network:
/etc/init.d/networking restart
(this will of course cut your ssh session so start a new one)
ping again.
it should work now.
Happy networking
Thanx!!!!!!!!!
to Kano for the best Linux ever!
and to DarkTiger, RoEn, RanETo, SheVegen & BlueLupo for their Wiki-Howto @ http://wiki.kanotix.net/CoMa.php?CoMa=PrivatesNetzwerkMitRouter
Copyrights may be reserved by the original autors, Rights of this document: CreativeCommons - NonCommercial
herb.solo - 3. Apr, 19:46
0 Kommentare - Kommentar verfassen - 0 Trackbacks