Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Linux and software for Linux (http://stream-recorder.com/forum/forumdisplay.php?f=61)
-   -  

Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10

(http://stream-recorder.com/forum/showthread.php?t=5370)

Stream Recorder 01-11-2010 05:58 AM

Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Suppose we have 2 computers, one of them has an Internet connection. We can connect them over firewire and get a local network:
Code:

sudo modprobe eth1394
sudo ifconfig eth2 192.168.200.1 up

sudo modprobe eth1394
sudo ifconfig eth8 192.168.200.2 up

Suppose that we connect to the Internet via LAN from 192.168.200.1. How to share this Internet connection over firewire onto 192.168.200.2?

On 192.168.200.1 do the following:
Code:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding

If the latter command gives the following error:
Code:

bash: /proc/sys/net/ipv4/conf/all/forwarding: Permission denied
uncomment the "net.ipv4.conf.default.forwarding = 1" line in the "/etc/sysctl.conf":
Code:

sudo gedit /etc/sysctl.conf
and remove the # in front of the "net.ipv4.conf.default.forwarding = 1"
Then apply the changes:
Code:

sudo sysctl -p
If the forwarding is enabled you will get 1
Code:

cat /proc/sys/net/ipv4/ip_forward 
1

otherwise you will get 0
Code:

cat /proc/sys/net/ipv4/ip_forward 
0

Now on the on the 192.168.200.2 do the following:
Code:

sudo route add default gw 192.168.200.1
That's it. You should have Internet connection on 192.168.200.2 now!

p.s. Windows XP allowed to share Internet connection over firewire, but you can't do that in Windows Vista and Windows 7.
But you still can use Windows XP, Linux or Mac OS...

Stream Recorder 01-12-2010 10:50 AM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Although Internet connection over firewire works fine, it stops working after rebooting.

You can repeat the following steps:

on computer #1
Code:

sudo modprobe eth1394
sudo ifconfig eth2 192.168.200.1 up
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

on computer #2
Code:

sudo modprobe eth1394
sudo ifconfig eth8 192.168.200.2 up
sudo route add default gw 192.168.200.1

You can also create a couple of .SH scripts and run them when needed. Any better ideas on how to restore the Internet connection on the second computer?

Stream Recorder 01-12-2010 11:11 AM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Please note that eth2 is used on my computer #1 for firewire, while eth8 is used on my computer #2 for firewire.

See what interfaces are used on your computer by running:
Code:

sudo ifconfig -a
Sample output of ifconfig -a:
Code:

sudo ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:16:76:cf:be:25 
          inet addr:10.01.255.01  Bcast:10.01.255.255  Mask:255.255.255.250
          inet6 addr: fexx::xxx:xxff:fecf:bexx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11417 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:7581084 (7.5 MB)  TX bytes:2162724 (2.1 MB)
          Memory:92200000-92220000

eth2      Link encap:UNSPEC  HWaddr 00-90-27-00-01-B3-AE-DC-00-00-00-00-00-00-00-00 
          inet addr:192.168.200.1  Bcast:192.168.200.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5247 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4945 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:685021 (685.0 KB)  TX bytes:4312734 (4.3 MB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:480 (480.0 B)  TX bytes:480 (480.0 B)

vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

As you can see the output of the above mentioned command doesn't mention 1394/iLink/Firewire.

elch 03-21-2010 02:46 PM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Great tutorial. I did not even know that I could share the internet connection via Firewire.

I haven't tried it out but it looks alright to me.

echo 1 > /proc/sys/net/ipv4/conf/all/forwarding

fails for you because you did not execute it as root. I'm saying this as sysctl is not recommended anymore. It will be removed in the next kernel releases. If the above command fails with sudo, try this:

sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/all/forwarding'

Stream Recorder 03-21-2010 03:00 PM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Thank you, elch.
Code:

sudo echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
was giving the permission denied error.

But I tried the following
Code:

sudo -i
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding

and it worked just fine.

My firewire Internet connection sharing has stopped working. I couldn't find the reason. And I was really tired to type all the commands. I just got a router... didn't really want to waste my time onto the problem anymore.

elch 03-21-2010 10:06 PM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
What about
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/all/forwarding'. This should create a shell and execute the "echo 1 > /proc/..." command within it.

The speed also interests me: Is this firewire connection faster than a Gbit ethernet connection?

If you're going to retry it some day and then run into problems again, "dmesg" will most likely contain the culprit.

Good luck.

Stream Recorder 03-22-2010 12:04 AM

Re: Sharing Internet connection over firewire (IEEE1394) in Ubuntu 9.10


 
Quote:

Originally Posted by elch (Post 17475)
What about
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/all/forwarding'. This should create a shell and execute the "echo 1 > /proc/..." command within it.

Works fine, thank you.

Quote:

Originally Posted by elch (Post 17475)
The speed also interests me: Is this firewire connection faster than a Gbit ethernet connection?

When I tried to transfer pictures, the speed was about 25MB/s (if I recall everything correctly). At least it didn't impress me much.

Quote:

Originally Posted by elch (Post 17475)
If you're going to retry it some day and then run into problems again, "dmesg" will most likely contain the culprit.

thank you. will try dmesg.


All times are GMT -6. The time now is 11:52 PM.