Pentru diferite distributii Linux/UNIX, mai jos se afla modalitatile de configurare minimala a retelei.
Date initiale:
a) interfata ce trebuie configurata: eth0
b) nu exista probleme de nivel fizic (cablu, probleme interfata defecta, etc)
c) cablul este straight (pt conexiunea cu un switch) sau cross-over (pt conexiunea cu un alt PC, router, etc)
d) in cazul configurarii statice:
- IP: 172.16.1.10
- Netmask: 255.255.255.0
- Gateway: 172.16.1.1
- DNS: 193.19.192.15, 193.19.192.16
- Hostname: server
- MAC: 00:0E:2E:90:D8:11
Configurare on-the-fly (non-persistenta)
# ifconfig eth0 hw ether 00:0E:2E:90:D8:11
# ifconfig eth0 172.16.1.10 netmask 255.255.255.0
# route del default gw
# route add default gw 172.16.1.1
- Fedora, CentOS, Mandriva, Red Hat
/etc/sysconfig/network-scripts/ifcfg-eth0
Static config | Dynamic config (dhcp) |
DEVICE=eth0 BOOTPROTO=static HWADDR=00:0E:2E:90:D8:11 IPADDR=172.16.1.10 NETMASK=255.255.255.0 NETWORK=172.16.1.0 BROADCAST=172.16.1.255 ONBOOT=yes DNS1=193.19.192.15 DNS2=193.19.192.16
| DEVICE=eth0 BOOTPROTO=dhcp HWADDR=00:0E:2E:90:D8:11 ONBOOT=yes |
/etc/sysconfig/network
Static config | Dynamic config (dhcp) |
NETWORKING=yes GATEWAY=172.16.1.1
| NETWORKING=yes
|
# /etc/init.d/network restart
- Debian, Ubuntu, Kubuntu, Xubuntu, Damn Small Linux (DSL), Linux Mint
/etc/network/interfaces
Static config | Dynamic config (dhcp) |
auto lo iface lo inet loopback
auto eth0 iface eth0 inet static hwaddress ether 01:02:03:04:05:06 address 172.16.1.10 netmask 255.255.255.0 network 172.16.1.0 broadcast 172.16.1.255 gateway 172.16.1.1 dns-nameservers 193.19.192.15 | auto lo iface lo inet loopback
auto eth0 iface eth0 inet dhcp hwaddress ether 01:02:03:04:05:06 |
- Gentoo
/etc/conf.d/net
Static config | Dynamic config (dhcp) |
config_eth0=( "172.16.1.10/24" ) routes_eth0=( "default via 172.16.1.1" ) mac_eth0="01:02:03:04:05:06"
| config_eth0=( "dhcp" ) dhcpcd_eth0="-t 10" #timeout after 10sec mac_eth0="01:02:03:04:05:06" |
/etc/resolv.conf
Static config |
nameserver 193.19.192.15 nameserver 193.19.192.16 |
- Slackware
/etc/rc.d/rc.inet1.conf
Static config | Dynamic config (dhcp) |
IPADDR[0]="172.16.1.10" NETMASK[0]="255.255.255.0" USE_DHCP[0]="no" DHCP_HOSTNAME[0]="" GATEWAY="172.16.1.1"
| IPADDR[0]="" NETMASK[0]=" " USE_DHCP[0]="yes" DHCP_HOSTNAME[0]="server" GATEWAY=""
|
/etc/resolv.conf
Static config |
nameserver 193.19.192.15 nameserver 193.19.192.16 |
- OpenSUSE, SUSE Linux Enterprise
/etc/sysconfig/network/ifcfg-eth0
/etc/sysconfig/network/config
Static config | Dynamic config (dhcp) |
STARTMODE=onboot BOOTPROTO=static BROADCAST=172.16.1.255 | STARTMODE=onboot BOOTPROTO=dhcp
|
/etc/sysconfig/network/routes
Static config |
sefault 172.16.1.1 |
/etc/resolv.conf
Static config |
nameserver 193.19.192.15 nameserver 193.19.192.16 |
- Solaris
/etc/hostname.eth0
Static config | Dynamic config (dhcp) |
|
|
- FreeBSD
/etc/rc.conf
Static config | Dynamic config (dhcp) |
hostname="server" ifconfig_eth0="inet 172.16.1.1 netmask 255.255.255.0 up" defaultrouter="172.16.1.1" | |
- OpenBSD
/etc/hostname.eth0
Static config | Dynamic config (dhcp) |
inet 172.16.1.10 255.255.255.0 NONE | |
/etc/mygate
Static config | Dynamic config (dhcp) |
172.16.1.1 | |
- NetBSD
/etc/ifconfig.eth0
Static config | Dynamic config (dhcp) |
inet 172.16.1.10 netmask 255.255.255.0 media 100baseTX | |
Niciun comentariu:
Trimiteți un comentariu