Previous |
Home | Next |
[bash]# vi /etc/modprobe.conf |
alias eth0 r8169 alias eth1 8139too |
This HOWTO assumes the eth0
device will be located on the external (public) network. |
[bash]# vi /etc/modprobe.conf |
alias net-pf-10 off |
[bash]# vi /etc/sysconfig/network-scripts/ifcfg-eth1 |
# Internal Ethernet
Device (STATIC) DEVICE=eth1 TYPE=Ethernet IPADDR=192.168.1.1 NETMASK=255.255.255.0 ONBOOT=yes USERCTL=no BOOTPROTO=static PEERDNS=no HWADDR=00:0D:61:67:D0:B2 <-- Adjust this, or leave MAC address blank. IPV6INIT=no |
ONBOOT |
Specifies whether the devices should start when the system starts (depending on network service) |
USERCTL |
Directs that only root, or all system users can control the device |
BOOTPROTO |
The protocol type used
to initialise the device (static |
dhcp | none) |
PEERDNS |
Import the DNS nameserver
settings into /etc/resolv.conf (careful if running own DNS) |
HWADDR |
Binds the physical MAC
address of the device - see caution
below |
Using the HWADDR
parameter may cause problems if the MAC address does not match the
intended device. For example, changing the physical devices or the
name of the alias in /etc/modprobe.conf
file. Leave this parameter blank if problematic and adjust later as required. |
Some of the older style parameters like NETMASK and BROADCAST have been deprecated because they can be calculated by the system with the ipcalc command. |
[bash]# vi
/etc/sysconfig/network |
# Network Details NETWORKING=yes HOSTNAME=galaxy.example.com GATEWAYDEV=eth0 |
[bash]# vi
/etc/sysconfig/network-scripts/ifcfg-eth0 |
# External Ethernet
Device (DYNAMIC) DEVICE=eth0 TYPE=Ethernet IPADDR= NETMASK= ONBOOT=yes USERCTL=no BOOTPROTO=dhcp PEERDNS=no HWADDR=00:00:21:E0:B8:B9 IPV6INIT=no |
[bash]# ifup eth0 [bash]# ifconfig eth0 up |
[bash]# ifup eth0 [bash]# ifconfig eth0 dynamic up |
[bash]# tail
/var/log/messages |
[bash]# ifdown eth0 [bash]# ifconfig eth0 down |
[bash]# chkconfig
--level 2345 network on [bash]# chkconfig --list network [bash]# /etc/init.d/network restart |
[bash]# ifconfig eth1 [bash]# ifconfig -a |
eth1
Link
encap:Ethernet
HWaddr 00:0D:61:67:D0:B2 inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:4812 (4.6 KiB) Interrupt:217 Base address:0xd000 |
[bash]# ifconfig
eth1 inet 192.168.1.1 broadcast
192.168.1.255 netmask 255.255.255.0 up |
[bash]# route -n |
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.214.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 |
[bash]# route add
default gw 10.214.64.254 dev eth0 |
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.214.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 10.214.64.254 0.0.0.0 UG 0 0 0 eth0 <-- Default Gateway |
[bash]# route -n |
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.214.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 <-- ZEROCONF default IP route 0.0.0.0 10.214.64.254 0.0.0.0 UG 0 0 0 eth0 |
[bash]# vi /etc/sysconfig/network |
NOZEROCONF=yes |
The value for the "NOZEROCONF" parameter can actually be set to any value, the initscripts only check to determine whether the parameter has zero length. So setting "NOZEROCONF=no" will have the same effect as setting it to "yes". You will need to comment or remove the variable to reactive ZEROCONF. |
[bash]# /etc/init.d/network restart |
[bash]# route -n |
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.214.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0.0.0.0 10.214.64.254 0.0.0.0 UG 0 0 0 eth0 |
Previous |
Home | Next |