I presume you have 2 Ethernet NICs eth0 and eth1, eth0 is connected to the gateway(modem I presume).
So you open up:
/etc/sysconfig/network-scripts/ifcfg-eth0 and input:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
HWADDR=00:80:48:EB:BC:FC
IPADDR=192.168.1.3
IPV6ADDR=
IPV6PREFIX=
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
Or if you want to have it done by DHCP:
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:80:48:EB:BC:FC
ONBOOT=yes
And for eth1 you seek up file:
/etc/sysconfig/network-scripts/ifcfg-eth1 and input:
DEVICE=eth1
BOOTPROTO=static
BROADCAST=10.0.0.255
HWADDR=00:11:6B:94:3B:39
IPADDR=10.0.0.1
IPV6ADDR=
IPV6PREFIX=
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
NETWORK=10.0.0.0
ONBOOT=yes
This one can not be done by DHCP and you can change the IP settings, those are mine that I use.
And finally you edit /etc/sysctl.conf and change:
net.ipv4.ip_forward = 0
to
net.ipv4.ip_forward = 1
Then you connect other computers up and assign them IPs automatically, if you want to have a DHCP server as well you'll need to install it first I think at least on CentOS it is like that and start it.
|