File to edit for networks connections?


12 posts
by Mobius » Sun Jan 06, 2013 8:13 pm
Ok, now that I mastered Raspbian (rollseyes) I'm playing around with Arch. In Raspbian, I had an existing network definition file that I was able to edit to set eth0 for static IP and to add the definitions for wlan0. I can't seem to find an equivalent file in Arch. Apparently, the kernal already has something that sets eth0 to DHCP mode so I'm making the rash assumption that I can modify that file (wherever it is) to my personal liking. Also, lsusb shows my wireless but how do I know if the driver is installed? I'm using the Edimax USB dongle which has the Realtek rtl8188CUS chip.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by pepedog » Sun Jan 06, 2013 8:23 pm
Code: Select all
#install netcfg
pacman -Sy netcfg
cp /etc/network.d/examples/ethernet-static /etc/network.d/ethernet-static
#Edit to you preference
nano /etc/network.d/ethernet-static
#Edit /etc/conf.d/netcfg
nano /etc/conf.d/netcfg
#Where it says NETWORKS=(last) change to NETWORKS=(ethernet-static)
#Finish up with
systemctl disable dhcpcd@eth0.service
systemctl enable netcfg.service
Posts: 940
Joined: Fri Oct 07, 2011 9:55 am
by Mobius » Sun Jan 06, 2013 10:29 pm
Great, thank you. I got the ethernet working with a static IP and then figured out how to make the wireless work with a static IP. Now what I need is a way to have both interfaces enabled at the same time like I can with Raspbian. The command NETWORKS=(menu) no longer works so I tried making a new file under etc/network.d and combined both the setups from ethernet-static and my equivalent wireless file. That's basically what I have working in Raspbian. Now it fails during boot up when it trys to run netcfg. The static IPs are different addresses so that's not a conflict.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by pepedog » Sun Jan 06, 2013 10:43 pm
You never said if wireless was static too?
If you had I would have added
Code: Select all
cp /etc/network.d/examples/wireless-wpa-static cp /etc/network.d/wireless-wpa-static
nano /etc/network.d/wireless-wpa-static
#edit to your liking
nano /etc/conf.d/netcfg
#Where it says NETWORKS=(last) change to NETWORKS=(ethernet-static wireless-wpa-static)
Posts: 940
Joined: Fri Oct 07, 2011 9:55 am
by Mobius » Sun Jan 06, 2013 11:20 pm
pepedog wrote:You never said if wireless was static too?
If you had I would have added
Code: Select all
cp /etc/network.d/examples/wireless-wpa-static cp /etc/network.d/wireless-wpa-static
nano /etc/network.d/wireless-wpa-static
#edit to your liking
nano /etc/conf.d/netcfg
#Where it says NETWORKS=(last) change to NETWORKS=(ethernet-static wireless-wpa-static)


Yes, I said in my reply that I also got wireless working with a static IP. I now want to be able to get both ethernet and wireless enabled at the same time like I can in Raspbian.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by pepedog » Sun Jan 06, 2013 11:25 pm
Yes, but you didn't indicate how you got wireless working
Do you want me to combine those 2 sets of instructions to make it clearer for you?
Posts: 940
Joined: Fri Oct 07, 2011 9:55 am
by Mobius » Mon Jan 07, 2013 4:28 am
pepedog wrote:Yes, but you didn't indicate how you got wireless working
Do you want me to combine those 2 sets of instructions to make it clearer for you?


I got wireless working by copying and editing one of the wireless files in the examples folder. I tried combining those two sets into a single file but the second set overwrites the first set. Apparently there is a code file that gets called based on the CONNECTION='xxx' line. I have yet to find anything in my internet searches that shows how netcfg can be used to activate two different interfaces at the same time.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by Mobius » Mon Jan 07, 2013 5:29 am
Supposedly you can activate multiple profiles by including them in the same NETWORKS array. So, in my case it would be:

NETWORKS=(wireless-wep ethernet-static)

Unfortunately, that would only activate the first entry in the array (I tried it both ways). Then I discovered that if I tried to activate the second interface manually (netcfg ethernet-static) it gave an error on the GATEWAY entry. Commented out the GATEWAY entry in ethernet-static profile and it brought up both interfaces (according to ifconfig). Unfortunately, I don't think the ethernet connection is working on it's own when I start the system without the wireless dongle. I'll try again tomorrow.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by pepedog » Mon Jan 07, 2013 10:29 am
You didn't mention wep before
You could have had
NETWORKS=(wireless-wep ethernet-static)
not
NETWORKS=(netcfg ethernet-static)
They relate to the file names in /etc/network.d/
Personally I name these files myeth0, myeth1
If you want to tweak stuff after network up you can put POST_UP="command you want" in last file of the array
Posts: 940
Joined: Fri Oct 07, 2011 9:55 am
by Mobius » Mon Jan 07, 2013 3:12 pm
As I said in my last post, I have tried:

NETWORKS=(wireless-wep ethernet-static)

It only brings up the wireless connection. If I try:

NETWORKS=(ethernet-static wireless-wep)

It only brings up the ethernet connection.

What seems to work is if I set GATEWAY=192.168.1.1 in only one of the network definition files. Setting it in the second one appears to work the best. Here are the two files:

/etc/network.d/wireless-wep
Code: Select all
CONNECTION='wireless'
DESCRIPTION='A simple WEP encrypted wireless connection'
INTERFACE='wlan0'
SECURITY='wep'
ESSID='My Router'
KEY='my key'
IP='static'
ADDR='192.168.1.67'
DNS=('192.168.1.1')


/etc/network.d/ethernet-static
Code: Select all
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection'
INTERFACE='eth0'
IP='static'
ADDR='192.168.1.66'
GATEWAY='192.168.1.1'
DNS=('192.168.1.1')


Note that the GATEWAY command is only in the second file called by NETWORKS=.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by pepedog » Mon Jan 07, 2013 3:32 pm
OK, this is fixed then?
Posts: 940
Joined: Fri Oct 07, 2011 9:55 am
by Mobius » Mon Jan 07, 2013 3:43 pm
I consider it a workaround and not a fix. It appears to work if I have both interfaces connected. If I disconnect either interface and reboot, then it no longer works. If I decide to use ARCH for any real application I will just use one interface. However, at this point, I don't see any advantage to using ARCH instead of Raspbian on the Pi.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA