Andrew McDonough

Please note: This page is imported from my wiki, which hasn't been updated in over 10 years. Some of the formatting was lost during the import. I'll try to get around to fixing it someday.

Linux Networking


with netstat : netstat -a | grep LISTEN

Network Configuration

In Debian the network settings are specified in /etc/network/interfaces In Redhat and Mandrake, this is found in /etc/sysconfig/network A network configuration file looks like this: NETWORKING=yes GATEWAY= # Optional - only used if pc isn’t connected directly to the internet

In Fedora/Redhat, on machines with a static IP address, this is set in /etc/sysconfig/network-scripts/ifcfg-eth0 e.g. … IPADDR= NETMASK= NETWORK= … The name server is specified in a separate file, usually /etc/resolv.conf

Starting a network device

ifconfig netmask up e.g. ifconfig eth0 up

Stopping a network device

ifconfig eth0 down

Setting the dafault gateway You also may need to check the gateway is setup: route add default gw

And the network interface is configured: ifconfig eth0 netmask up

Name Servers

Name Servers are specified in /etc/resolv.conf you must restart the name daemon to take effect (e.g. kill the process then /usr/local/sbin/named -u named)

Andrew McDonough

Andrew McDonough is a consultant CTO and software developer, currently based between Berlin and London.

Follow Andrew on Twitter or Connect on LinkedIn