You are not logged in.

#1 2007-08-18 16:24:40

raja
Member
From: Canada
Registered: 2007-07-04
Posts: 12
Website

Connecting to wired internet

I use a wireless connection most of the time and connect up to it by specifying the ESSID and password in the rc.conf. However, there are a few times when I have to connect to a wired connection at work. If I dont want to use networkmanager just for this, how will go about with it?
I am running KDEmod as my DE and have tried doing  'ifup eth1' and 'ifconfig eth1='dhcp''. This doesnt work.


Thinkpad X40 running Ubuntu feisty and Archlinux

Offline

#2 2007-08-18 16:48:08

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: Connecting to wired internet

try

ifconfig eth1 up
dhcpcd eth1

Cheers Sigi

edit:
or just add the following into the networking section of your /etc/c.conf:

eth1="dhcp"
INTERFACES=(lo eth0 eth1)

Last edited by Sigi (2007-08-18 16:51:00)


Haven't been here in a while. Still rocking Arch. smile

Offline

#3 2007-08-20 22:23:17

raja
Member
From: Canada
Registered: 2007-07-04
Posts: 12
Website

Re: Connecting to wired internet

OK - took me some time to check it out and find that it did not work.
If  i have the lines in rc.conf as suggested, will it still connect to a wired network as soon as the ethernet cable is plugged in or will I have to restart network ? Will I need to have any specific modules / daemons running for this to happen ?


Thinkpad X40 running Ubuntu feisty and Archlinux

Offline

#4 2007-08-20 23:35:44

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: Connecting to wired internet

raja wrote:

OK - took me some time to check it out and find that it did not work.

Can you please be a little more precise on what id work and what didn't?

raja wrote:

If  i have the lines in rc.conf as suggested, will it still connect to a wired network as soon as the ethernet cable is plugged in or will I have to restart network ? Will I need to have any specific modules / daemons running for this to happen ?

IIRC, you'll have to restart the network daemon or run dhcpcd manually afterwards, but I'm not sure about that... Just try out if you get an IP if dhcpcd is running when you plug in the network cable.


Haven't been here in a while. Still rocking Arch. smile

Offline

#5 2007-08-21 23:58:05

raja
Member
From: Canada
Registered: 2007-07-04
Posts: 12
Website

Re: Connecting to wired internet

Sigi,
I appreciate your efforts to help me.
Here is what happens step by step when I manually try to connect to a wired network.

[raja@arch ~]$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0A:E4:2E:B6:CE
          inet addr:169.254.76.153  Bcast:169.254.255.255  Mask:255.255.0.0
          UP 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)
          Base address:0x7000 Memory:d0200000-d0220000

###############
##inserted ethernet##
##############

[raja@arch ~]$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0A:E4:2E:B6:CE
          inet addr:169.254.76.153  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::20a:e4ff:fe2e:b6ce/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1108 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1080 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:375633 (366.8 Kb)  TX bytes:372096 (363.3 Kb)
          Base address:0x7000 Memory:d0200000-d0220000

[raja@arch ~]$ ping www.google.ca
ping: unknown host www.google.ca
[raja@arch ~]$ sudo /etc/rc.d/network restart
:: Stopping Network                                                                         [DONE]
:: Starting Network                                                                         [DONE]
[raja@arch ~]$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0A:E4:2E:B6:CE
          inet6 addr: fe80::20a:e4ff:fe2e:b6ce/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7182 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7016 errors:1 dropped:0 overruns:0 carrier:1
          collisions:1 txqueuelen:100
          RX bytes:2448256 (2.3 Mb)  TX bytes:2425952 (2.3 Mb)
          Base address:0x7000 Memory:d0200000-d0220000

[raja@arch ~]$ ping www.google.ca
ping: unknown host www.google.ca
[raja@arch ~]$ sudo dhcpcd eth1
[raja@arch ~]$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0A:E4:2E:B6:CE
          inet addr:10.2.58.232  Bcast:10.2.59.255  Mask:255.255.254.0
          inet6 addr: fe80::20a:e4ff:fe2e:b6ce/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7268 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7023 errors:1 dropped:0 overruns:0 carrier:1
          collisions:1 txqueuelen:100
          RX bytes:2461880 (2.3 Mb)  TX bytes:2426972 (2.3 Mb)
          Base address:0x7000 Memory:d0200000-d0220000

[raja@arch ~]$ ping www.google.ca
PING www.l.google.com (64.233.167.147) 56(84) bytes of data.

--- www.l.google.com ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9006ms

Here is my rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/unimaps
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE=
HARDWARECLOCK="localtime"
TIMEZONE=Canada/Pacific
KEYMAP=us
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

#
# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# Scan hardware and load required modules at bootup
MOD_AUTOLOAD="yes"
# Module Blacklist - modules in this list will never be loaded by hwdetect
MOD_BLACKLIST=()
#
# Modules to load at boot-up (in this order)
#   - prefix a module with a ! to disable it
#
MODULES=(!usbserial snd-intel8x0 snd-pcm-oss ipw2200 speedstep_centrino vboxdrv)
# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

#
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
HOSTNAME="arch"
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
#eth1="eth1 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
eth1="dhcp"
wlan_eth0="eth0 essid XXXXXXX key XXXXXXXX"
WLAN_INTERFACES=(eth0)
INTERFACES=(lo eth0 eth1)
#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
#
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network-profiles
#
#NET_PROFILES=(main)

#
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng !hotplug !pcmcia netfs crond acpid cpufreq 
laptop-mode alsa)


# End of file

Thinkpad X40 running Ubuntu feisty and Archlinux

Offline

#6 2007-08-22 14:40:43

CyberKieken
Member
Registered: 2006-08-01
Posts: 6

Re: Connecting to wired internet

I use wireless at home, but wired at school. So in my rc.conf, only the wireless is started automatically and when I'm at school I do the following after booting:

$ ifconfig eth0 up
$ ifconfig wlan0 down
$ dhclient eth0

And it works just fine...
(eth0 is wired, wlan0 is wireless, but I guess you figured that out wink)

Offline

#7 2007-08-22 16:21:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Connecting to wired internet

dhcpcd is the default on Arch systems - dhclient works, of course, but you would have to install it first.

If you are going to be switching between wired and wireless frequently, you could set up profiles for them, and use the netcfg script. Configure the relevant section in rc.conf, and see /etc/network-profiles/template for details.

Offline

Board footer

Powered by FluxBB