Posted by: isaraffee | August 10, 2009

Configuring Network to Gateway via Ethernet Cable in Sabayon Linux

Configuring Network to Connect to Gateway via Ethernet cable

To connect your Sabayon worstation/laptop to the Internet via a gateway, you need to set the network setting on Sabayon to use dhcp and not static ip. In my case I use Ethernet cables to connect to the gateway rather than by wireless method. This is because my Sabayon hanged once the USB wireless stick was inserted to the USB port.

Initially I set the network settings by using static ip, default gateway and etc but failed to connect to the Internet. Then I realized you need to use dhcp. So this is what you need to configure on your Sabayon.

Firstly, make sure your gateway, this could be your PC (either running Linux or Windows) that is already connected to the Internet. Plug in the Ethernet cable from your Sabayon to the router. Then open your Terminal in Sabayon and type:

sabayonx86 ~ # ifconfig

eth0 Link encap:Ethernet HWaddr 00:08:02:95:ED:3E

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:42249 errors:0 dropped:0 overruns:0 frame:0

TX packets:28708 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:61413397 (58.5 Mb) TX bytes:2141139 (2.0 Mb)

Interrupt:11

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 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:0

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

your Sabayon would not have any ip address configured to your eth0. You can also type:

sabayonx86 ~ # ip route show

127.0.0.0/8 dev lo scope link

This further shows that no ip address has been set. To configure the network settings, you can use GUI or command line. Let’s do the GUI method.

Type net-setup. You will be presented with a menu. Select the lan card. in my case eth0 and follow the menu. When you are prompted as to whether to set your ip address or use dhcp, hoose te former, I.e, by dhcp. After you have exited the net-setup menu, type ifconfig and you will see this:

sabayonx86 ~ # ifconfig

eth0 Link encap:Ethernet HWaddr 00:08:02:95:ED:3E

inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:42249 errors:0 dropped:0 overruns:0 frame:0

TX packets:28708 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:61413397 (58.5 Mb) TX bytes:2141139 (2.0 Mb)

Interrupt:11

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 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:0

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

This shows that the ip address 192.168.1.101 was assigned to your lan card eth0. You can ping the address of your gateway I.e your router, and in my case 192.168.1.1. You will get successful replies. TYpe the following command :

sabayonx86 ~ # ip route show

192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.101

127.0.0.0/8 dev lo scope link

default via 192.168.1.1 dev eth

The third line shows that the default gateway was also set to the ip address of the gateway I.e. 192.168.1.1.

Now try to open a web browser and go to any Internet site. If you fail to browse any sites, I suggest you reboot your Sabayon. In my case, I need to reboot mine. After I rebooted, I can surf the Net. It’s important that you check that Sabayon retained its network settings after reboot. This is because sometimes your network settings will be lost. Hence type the commands discussed earlier and make sure you have the same output. One more command that is worth mentioning is :

sabayonx86 ~ # more /etc/conf.d/net

# This network configuration was written by net-setup

iface_eth0=”dhcp”

This shows that the network settings is set to use dhcp.

I also recorded other command output as shown below, which in my view will serve as important reference in the future.

sabayonx86 ~ # netstat -rn

Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

  1. 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

If you explore the /etc/resolv.conf file, you will see that the nameserver is assigned to the gateway ip address.

sabayonx86 ~ # more /etc/resolv.conf

# generated by NetworkManager, do not edit!

nameserver 192.168.1.1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: