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.
with netstat : netstat -a | grep LISTEN
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 HOSTNAME=p15145407.pureserver.info GATEWAY=192.158.254.1 # 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=192.168.254.14 NETMASK=255.255.255.0 NETWORK=192.168.254.0 … The name server is specified in a separate file, usually /etc/resolv.conf
ifconfig
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 192.168.254.9 netmask 255.255.255.0 up
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 is a consultant CTO and software developer, currently based between Berlin and London.
Follow Andrew on Twitter or Connect on LinkedIn