|
Linux HowTo's -
Linux Networking HowTo's
|
|
Written by Allen Sanabria
|
|
Sunday, 10 February 2008 18:52 |
|
I will try to make this tutorial as general as possible, as I can give you the REDHAT way of doing things as concerns to where REDHAT base systems maintain there networking files or Gentoo based systems...etc
-
Lets start with the basics....
- To view all your active network interface
run this command "ifconfig"
sabayon-dynasty ~ # ifconfig eth0 Link encap:Ethernet HWaddr 00:0E:35:94:FB:D9 inet addr:192.168.101.5 Bcast:192.168.101.255 Mask:255.255.255.0 inet6 addr: fe80::20e:35ff:fe94:fbd9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2656195 errors:0 dropped:19 overruns:0 frame:0 TX packets:1762149 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3593125256 (3426.6 Mb) TX bytes:144856589 (138.1 Mb) Interrupt:10 Base address:0xe000 Memory:e0200000-e0200fff
- Or you can be specific and run (ifconfig and the interface name)"ifconfig eth0"
-
Setup your network interfaces!
- REDHAT WAYFor redhat based systems you will have to do this (assuming your network interface is eth0 and using DHCP)..
"vi /etc/sysconfig/network-scripts/ifcfg-eth0"
DEVICE=eth0 BOOTPROTO=dhcp HWADDR=00:E0:81:24:CQ:82 ONBOOT=yes
- Now for a static ip setup (assuming eth0)..
"vi /etc/sysconfig/network-scripts/ifcfg-eth0"
DEVICE=eth0 BROADCAST=192.168.101.255 BOOTPROTO=static HWADDR=00:E0:81:24:CQ:82 IPADDR=192.168.101.5 NETMASK=255.255.255.0 NETWORK=192.168.101.0 ONBOOT=yes TYPE=Ethernet
- Now run this "service network restart" or run this "ifdown eth0" to make sure the interface is down, then "ifup eth0"
-
GENTOO WAYFor gentoo based systems you will have to do this.
- (assuming your network interface is eth0 and using DHCP)..
"vi /etc/conf.d/net"
config_eth0=( "dhcp" ) dhcp_eth0="nosendhost" dns_domain_eth0="linuxdynasty"
- Now for a static ip setup (assuming eth0)..
"vi /etc/conf.d/net"
config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" ) routes_eth0=("default via 192.168.0.1") # IPv4 default route
- Now run this "rc-update add net.eth0 default" so that it is in the default run level.
- Now to get the interface up and running...
"/etc/init.d/net.eth0 restart"
|
|
Last Updated ( Wednesday, 14 May 2008 21:40 )
|