HowTo Configure a network card in Suse/openSUSE 10, 11 for LAN and Internet Access.
This is a story told in screenshots, about configuring network interfaces in Yast. It's for fixed networks e.g. a SOHO LAN (where a Network manager is not appropriate). If you frequently switch between networks you should use a Network Manager rather than the GUI in Yast.
Here are some of the focus areas:
I'm in a hurry, just tell me which pictures to use.
IP Addressing: The majority of Suse installations that use network interfaces to connect to the internet, do so through a cable modem or a DSL/ADSL modem, sometimes through a router. These devices are set to "serve" or allocate IP addresses from internal DHCP servers to workstations as they boot up and come on line. These are called "dynamic IP addresses". They are the do-nothing default way of getting an IP address. Suse's default installation assumes your workstation has a network interface that's connected to a DHCP server (e.g. router or modem) and thus it will likely receive its first IP address dynamically.
If your workstation is also a Server that maintains a network-wide service like Print Server or File Server etc, you would be well advised to give it a fixed IP address. Indeed the Administrator of a network where all IP addresses are fixed is much advantaged.
Dynamic IP Setup I - The Suse/openSUSE Defaults. Pics 1 to 6 inclusive
This is what you get when you install the operating system and accept all defaults. When it breaks or when you change/add a network interface, this section will lead you back to the excellent default configuration.
Open Yast --> Network Devices --> Network Card and the "Overview" screen displays:
Two network interface cards are displayed in this screenshot, a wireless NIC and an on-board NIC. The details for whichever NIC you highlight are displayed in the lower gray panel.
The "Global" Tab sets some miscellaneous parameters.
Under "Hostname/DNS" you can name the card (hostname) for Linux networking and allocate a pointer to the Domain Name Server where IP addresses are resolved from domain names.
The "Router" Tab allows you to point to the device that provides the gateway to the internet.
It doesn't matter which interface/NIC is highlighted at this stage because the other three Tabs, Global, Hostname/DNS and Router set parameters that apply to all cards that are listed here. First consider the "Global" options:
Network Setup Method: Knetworkmanager can be a bit Kantankerous with wireless cards. There are fine alternatives like the Gnome-applet and wifi-radar. NetworkManager-gnome RPM is great for Gnome and Andrewd18 provides the RPM for wifi-radar to replace Knetworkmanager in KDE. I use and recommend IFUP if you're not using roaming wireless networks.
IPv6 Protocol Settings: IPv6 is not yet in wide use. We nearly exclusively use IPv4. Leave IPv6 disabled for the present. If it's active it can badly degrade your web browsing by delaying page loads.
DHCP Client Options: Generally leave these alone; you see here the defaults.
Next activate the "Hostname/DNS" Tab to set networking names and name resolvers.
The hostname and domain name are first set during openSUSE's installation. The hostname is written to the file /etc/hosts as a fundamental identifier of this workstation in Linux networking. Long ago machines on the Internet were only reachable via the list of IP addresses and matching names in the /etc/hosts file.
The domain name can be a full domain name like "www.swerdna.org" or a workgroup name like "swerdna".
Leave the x-marks in "Change Hostname via DHCP" and in "Write Hostname to /etc/hosts".
You won't see (except perhaps faintly underneath the gray) the blue writing that I've added to show what's going on behind the scenes. If you have a LAN, however small, even just one workstation, the software will seek out the real Name Servers supplied by your ISP through the Gateway, which in this example is at 192.168.2.1 in a router. Even though you might not see it, you will "Update DNS via DHCP" should that be available. In this modern way the /etc/hosts file is superseded as your primary Internet Name Resolver.
Next we have the "Routing" Tab:
This is the place to identify the route to the internet, most often called the "Gateway".
When the IP address is served from a DHCP server, the server is usually but not necessarily associated with a hardware device that leads to the internet. As a result the gateway is already known through programming in the software associated with the DHCP client and it's not necessary to put anything here.
Here you see the openSUSE defaults for a standard DHCP setup. In release 10.2 this panel is locked when addressing is set to DHCP but open in the other releases.
That completes the broad network settings that apply to all network interfaces. Now return th the "Overview" Tab where you can highlight particular cards and activate Yast's "Configure" Module for individual cards. Revisit Pic 4 and activate "configure" to get this screen:
In this GUI you can switch from dynamic addressing to fixed IP addressing. The information in blue is required (and frequently supplied automatically) for first time configuration of cards. When re-configuring from fixed IP to DHCP and vice versa the device type and configuration name will be grayed out.
The "Hardware" Tab is usually a non-event for workstations or SOHO LANs. For the sake of completeness I've linked here the (blank) default configuration.
Now move to the "General" Tab to set the last few parameters. The panel in Pic 6 will open up
Device Activation: Usually this is set to "At Boot Time" to use the card straight away. A removable interface may be configured to activate "On HotPlug". If you have more than one interface, typically a wireless interface as well as a wired interface in a typical SOHO LAN, NOTE that you cannot successfully have two active cards on the same subnet in the same machine; e.g. 192.168.2.7 and 192.168.2.80 won't do. So you would configure one to activate at boot and the other to activate as required; e.g. "On Cable Connect", "Manually" or "Never".
Firewall Zone: Network cards are set in the firewall's external zone for the standard SOHO LAN. FYI the single workstation using a broadband A/DSL or Cable modem is on a (very small) LAN so even for it the NIC should be in the external zone. You might see ill informed advice in Forums to set the SOHO NIC to the Internal Zone to reduce networking difficulties. If you do that on a SOHO LAN you effectively cut out the firewall and make it useless. When I'm setting up a NIC or varying anything in my network I simply turn my firewall off until I'm satisfied the change is effective. Then I turn the firewall back on and see whether I need to make a configuration change to the firewall to accommodate the network reconfiguration. Dealing with NICs and firewalls concurrently is so much more complicated that dealing with them consecutively.
Enable Device Control for Non-root user via Kinternet: That's almost self-explanatory.
Maximum Transmission Unit: MTU sometimes needs to be varied for some routers or switches. Generally it should be left alone. If you want o see the MTU of a device then issue this root shell command: ifconfig.
In summary, for the default DHCP configuration use Pics 1 to 6 inclusive.
Dynamic IP Setup II - Manually set Gateway & Name Resolution.
Pics 1, 2, 5, 6, 7 and 8
The DHCP setup just described is very effective in Suse. I believe the adage "If it works don't fix it". Sometimes however it doesn't work, inexplicably, or just as inexplicably it stops working according to the questions I see on support forums. After all, most Linux users are "fiddlers". The following changes often fix the problem.
It seems that sometimes the automatic knowledge of the pathway/gateway to the internet gets lost and/or the passind down of Name Server function through the router stops working. The tweaks are simply to specify the Name Resolvers and the Gateway, using the screens for "Hostname/DNS" (Pic 3) and "Routing" (Pic 4). Here are the steps you must follow in order to restructure Hostname/DNS from the config in Pic 3 to that below in Pic 7.
Follow these steps in this order to set static Name Servers and hostname:
It remains to set the Gateway manually in the Tab for "Routing". That's almost trivially simple once Pic 7 is completed. Just add the IP address of the router into the "Gateway" slot under the "Routing" Tab in Pic 4.
In summary, for DHCP on steroids use Pics 1, 2, 5, 6, 7 and 8
Setup for Fixed IP Addressing. Manually set everything. Pics 1, 2, 6, 7, 8 and 9
For fixed IP addressing you obviously change the configuration under the "Address" Tab, replacing Pic 5 with the version just to the left, Pic 9, where the IP address is simply consistent with the subnet in use in the LAN. Everything else is set manually, so the additional configurations that satisfy that criterion are in Pics 1, 2, 6, 7 and 8.
Wireless cards - Additional Configuration
If you have a wireless interface, when you finish the six-panel normal configuration above and move on, Pic 10 will open:
There are modes other that the "managed", "open" mode with "hexadecimal" key. I'll leave you to experiment with those and simply show you one that does work, to get you up and working. Then there are only two adjustables: the ess-id and the hexadecimal number. The essid is simply a word that your neighbours don't use - it's visible to nearby wireless networks. Privacy is obtained through the hex key. I simply use a passphrase in my router (which you can view in your browser at the IP address of your "gateway", e.g. for this example LAN it's http://192.168.2.1) and I copy the hex number that passphrase generates, over into the Suse box's wireless interface (Pic 10). There's a page devoted to Wireless interfaces on this site with a much fuller discussion on how to deal with them. Here's a link.
Take it easy.
Swerdna, 23 October 2007