Static IP or Ethernet?

Discuss solutions for wired and wireless usage for sharing and Internet connectivity.

Static IP or Ethernet?

Postby OldDog » Tue Feb 05, 2008 1:41 pm

My home network uses static ip addresses. I also purchased a D-Link DUB-E100 usb to ethernet connector and my olpc has recognized it on boot up (Verified by less /proc/bus/usb/devices).

Now how do I connect to my network? I'm familiar with Debian but there is no /etc/network/interfaces with which to configure a static ip address. I tried reading the FAQ for using an ethernet connection but there were no instructions other than a reference to a lengthy source program.
OldDog
 
Posts: 5
Joined: Tue Feb 05, 2008 1:27 pm

Re: Static IP or Ethernet?

Postby pgf » Tue Feb 05, 2008 4:38 pm

the XO wasn't really intended to be used on ethernet much, so they don't seem to have made it easy to configure, and keep it configured.

the command you want is as follows. you must be root (i.e., use the "su" command first):
Code: Select all
ifconfig eth1 192.168.1.2 up

obviously you should substitute the address you've chosen for the one i typed above. you might also want to verify that "eth1" is your ethernet adapter. it almost certainly is, but it's worth checking. (eth0 is the wireless on this machine.) also, you might need to give a full path to ifconfig: /sbin/ifconfig.

then, to tell the XO where your router is (so that it can find the internet) you'll need to type:
Code: Select all
route add default gw 192.168.1.1 dev eth1

again, substitute your router's real address.

as for making this "sticky", i'm not sure how to do that. i have various ideas, but without an XO in front of me (they're telling me late march, now) i don't want to mislead you.

paul
pgf
 
Posts: 106
Joined: Thu Jan 03, 2008 10:48 am

Re: Static IP or Ethernet?

Postby ektoric » Tue Feb 05, 2008 5:12 pm

OldDog wrote:I'm familiar with Debian but there is no /etc/network/interfaces with which to configure a static ip address.

The XO is based on fedora, so the file layout is a little different. In fedora distro world, the file would be:
Code: Select all
/etc/sysconfig/network-scripts/ifcfg-eth1
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Static IP or Ethernet?

Postby OldDog » Wed Feb 06, 2008 9:38 am

The ifconfig command doesn't exist so that suggestion doesn't work.

I did find /sysconfig/network-scripts/ifcfg-eth0 and the contents were

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=no

This is a little different from Debian so I guess I must learn a little Fedora.
OldDog
 
Posts: 5
Joined: Tue Feb 05, 2008 1:27 pm

Re: Static IP or Ethernet?

Postby ektoric » Wed Feb 06, 2008 11:37 am

OldDog wrote:The ifconfig command doesn't exist so that suggestion doesn't work.

Many commands seem like they "don't exist", but are simply not in your default PATH.
Most of the commands that are meant to be run by a system administrator are in the /sbin or /usr/sbin path. ifconfig is /sbin/ifconfig. You can run it as an unprivileged user to view current settings, but you would need to run it as root to change settings.

"su" will drop you to root user, but with the current user's environment (and PATH). "su -" will drop you to root user and root environment, with root's PATH.
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Static IP or Ethernet?

Postby pgf » Wed Feb 06, 2008 12:09 pm

OldDog wrote:The ifconfig command doesn't exist so that suggestion doesn't work.

I did find /sysconfig/network-scripts/ifcfg-eth0 and the contents were

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=no

This is a little different from Debian so I guess I must learn a little Fedora.


okay -- this is coming back to me now. i just checked on a fedora machine.

i assume you meant to put "/etc" at the front of that pathname, above?

try creating /etc/sysconfig/network-scripts/ifcfg-eth1, and give it the following contents:
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.1.24 (your address)
NETMASK=255.255.255.0
NETWORK=192.168.1.0 (same, but with zero in last position)
ONBOOT=yes

the address of your network router (your "gateway") should go in /etc/sysconfig/network, as:
GATEWAY=192.168.1.1 (your router's address)

then, run: "/etc/sysconfig/network-scripts/ifup-eth eth1"

if your adapter is present at boot, you might not need to invoke that by hand -- it might happen automatically. (it depends on when USB devices are recognized during boot: i.e., before or after the networks are configure.)

paul
pgf
 
Posts: 106
Joined: Thu Jan 03, 2008 10:48 am

Re: Static IP or Ethernet?

Postby OldDog » Thu Feb 07, 2008 9:56 am

Thanks, I entered the ifcfg-eth1 file and am now connected to my home network. The gateway instruction did not work so I cannot reach the internet. I'm going to check the olpc instructions again as this should be a problem for wireless connections too.
OldDog
 
Posts: 5
Joined: Tue Feb 05, 2008 1:27 pm

Re: Static IP or Ethernet?

Postby ektoric » Thu Feb 07, 2008 1:20 pm

OldDog wrote:The gateway instruction did not work so I cannot reach the internet.

There's being able to reach the internet via IP address, and there's being able to reach it via DNS names.

If you "ping yahoo.com" and get "unknown host" or "unable to resolve host", then try pinging an IP address, e.g. 209.191.93.52

If you can ping an IP address but not by name, then your gateway is fine. You'll need to add your DNS servers to /etc/resolv.conf. The only problem is, resolv.conf is regenerated each time DHCP kicks in by dhclient (when your eth0 wireless kicks back in), so I'm not sure off the top of my head how to add your DNS server persistently.
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Static IP or Ethernet?

Postby OldDog » Thu Feb 07, 2008 2:57 pm

OK and Thanks. I made a copy of resolv.conf to use when the edited file gets overwritten.
OldDog
 
Posts: 5
Joined: Tue Feb 05, 2008 1:27 pm


Return to Networking / Internet

Who is online

Users browsing this forum: No registered users and 2 guests

cron