LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2006, 11:50 PM   #1
linuxbotx
Member
 
Registered: Oct 2003
Location: USA
Distribution: Fedora Core 4
Posts: 247

Rep: Reputation: 30
PS2 Internet Connection Sharing


PLEASE READ THE ENTIRE GUDE BEFORE ASKING QUESTIONS. YOU MAY NEED TO CHANGE SOME THINGS!

This is a simple guide to get Internet Connection Sharing to work with Fedora Core 4 with the PS2, XBOX/XBOX 360. Pleas note, I have not tested this with the XBOX and 360, but in theory it should still work.

Before you begin, please review these prerequisites that you will need.

1 CAT 5 Crossover Cable (Similar to Cat 5 cable). It may work with regular Cat 5, but ICS is best used with Crossover Cable. You can pick it up at your local radio shack.

2 NIC’s. You can use either 2 Ethernet cards, or one wireless card and one Ethernet card. The Ethernet is used to connect the Cat 5 cable to your PS2 Ethernet card. If you have 1 wireless card connecting you to your Internet connection, be sure you have it working and your internet connection is active.

Have IPTABLES installed. You can check this by typing: rpm –q iptables

Have DHCP installed. Check this by typing: rpm –q dhcp

I recommend FireStarter Firewall. You can get it at: www.fs-security.com . Any firewall will do, but this is the easiest firewall for most Linux Distros.



NOTES:

My network is wireless. My router is downstairs, and my Linux PC is upstairs along with my PS2. This guide is designed to create a network within a network using DHCP. I tried to get this to work with Static IP’s, but for some reason Sony’s DNAS was unable to verify with a static IP assigned to the PS2.

Please configure your PS2 Network card to use automatic IP addresses and automatic DNS.

My internal network is behind a router, so my local network uses 192.168.0.X
I have to setup my PS2 network to use the 10.0.0.X So my PS2 is on its own little network, using my Linux PC as a gateway to my router and internet connection.

This is designed to work under Fedora Core 4. The same concept will work under all disros, but the location of the configuration files may be different, as well as the commands to bring up and down the network. If you are running other distributions, please research the appropriate commands. I can’t support a distro that I’m not running.



DEVICES:

If your PC is also behind a router please follow the same IP addresses. If you are not behind a router and your PC is directly connected to the Internet you can change the IP’s to 192.168.0.X series. But it’s optional.

ath0 is my Internet connection
eth0 is my internal connection

Your configuration is more than likely different, so please modify where necessary.



STEP 1: Network Shutdown

Shut down all your network cards.

# service network stop

to be sure that everything is off type:

# ifconfig

if anything other than loopback is up (lo) you can shut down the devices by typing:

# ifdown <device name>

Now stop any DHCP connections

# service dhcpd stop

If you get an error message or if it fails, don’t worry. Your connection is either already off, or not configured.



STEP 2: Configuration Files

Go to this directory:

# /etc/sysconfig/

edit the file: network
be sure it looks something like this:

NETWORKING=yes
HOSTNAME=localhost.localdomain
FORWARD_IPV4=yes
GATEWAYDEV=ath0

Save the file

Go to this directory:

# /etc/sysconfig/networking/devices/

Now you must edit the two network device files. Here is an example of the two files

ifcfg-ath0 ifcfg-eth0

Since Linux configured ath0 during startup and already works as the Internet connection, you should not need to edit it. But to be safe make sure that inside the file this setting is set:

ONBOOT=yes

Now save and exit. Open or create the file:

# ifcfg-eth0

Enter the following information and nothing more:

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.0
USERCTL=yes
PEERDNS=no
GATEWAY=ath0
TYPE=Ethernet
IPADDR=10.0.0.1

Save and exit

Go to the following directory:

# /etc/

edit or create the file:

# dhcp.conf

Be sure it looks like this:

ddns-update-style interim;

default-lease-time 600;
max-lease-time 7200;

subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers XXX.XXX.XXX, XXX.XXX.XXX, XXX.XXX.XXX;
range 10.0.0.2 10.0.0.20;
}

Save and exit. But obviously change the XXX's to your ISP's domain name servers.

Now you have to enable the forwarding. Type:

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

And now edit the file:

# /etc/sysctl.conf

Change
net.ipv4.ip_forward = 0
to
net.ipv4.ip_forward = 1

Save and exit



STEP 3: Bringing up the network

Now you must configure IPTables. This will allow your second NIC to share the connection with your first one

Type the following to share the connection

# iptables -P FORWARD ACCEPT
# iptables -t nat -A POSTROUTING -o ath0 -j MASQUERADE

Now save the configuration to always start

# service iptables save

Now start dhcp:

# service dhcpd start

or

# service dhcpd restart

Now set dhcpd to always start on boot:

# chkconfig dhcpd on

Bring up the network

# service network start

or

# service network restart

It may take a minute or two for the devices to get their IP via DHCP
Once this is done check your connections:

# ifconfig

Be sure that all the devices have their own IP. If a device does not have it’s own IP then go over all the steps again. You will need to shut down the network devices if you need to change something. This will make configuration easier.

Now you need to start firestarter.

Go through the configuration. Set the Internet device, and then set your second NIC for Internet Connection Sharing. ONLY enable ICS, DO NOT check the box for DHCP in Firestarter. This will mess with your configuration.

Now that firestarter is up, turn on your PS2 and start playing online!



SUMUP

PLEASE NOTE:

Obviously your Internet devices may not be the same as mine. Be sure to modify accordingly.

Now what this does, is you are basically assigning your second NIC a static IP, and telling it to assign a dynamic IP to any device that connects to it.

Once you have this all up and running, you have just created your first Dedicated Linux Firewall! You can use this guide to connect your Linux PC to other computers. Want to have some fun? Find a router and connect multiple computers to the router and connect the switch to your Linux PC. BAM! DHCP NETWORK.

If you have any questions please post here. But to avoid redundant questions, read the entire guide and modify according to your setup. (Such as IP or devices)

-LinuxBotX

Last edited by linuxbotx; 01-26-2006 at 12:06 AM.
 
Old 01-26-2006, 07:22 PM   #2
munkie_poo
Member
 
Registered: Apr 2004
Location: Newcastle, UK
Distribution: Slackware 10.2
Posts: 134

Rep: Reputation: 15
he he beat ya

http://www.linuxquestions.org/linux/..._online_gaming


I also found the network disk Sony send you (the one with the tank game on) is poo. I couldnt set up a connection with it, I spent ages wondering why my Linux box wouldnt assign it an IP.
Then I tried the original disk that came with the adapter and it worked straight away. go figure?



btw what games do you play online?

Last edited by munkie_poo; 01-26-2006 at 07:24 PM.
 
Old 01-26-2006, 09:51 PM   #3
linuxbotx
Member
 
Registered: Oct 2003
Location: USA
Distribution: Fedora Core 4
Posts: 247

Original Poster
Rep: Reputation: 30
lol wish i found that link eariler. Took me about 36 hours of hair pulling work to get it to work correctly
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Connection Sharing yoav_by Linux - Networking 2 03-20-2005 03:22 PM
Internet Connection Sharing usa1234 Linux - Networking 1 10-28-2004 05:27 PM
Internet connection sharing mark_booze Linux - Newbie 22 01-02-2004 12:37 AM
Internet Connection Sharing Keys Linux - Networking 5 03-09-2003 03:48 PM
Internet Connection Sharing Chijtska Linux - Networking 7 09-02-2002 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration