ifconfig eth0 192.168.0.2 netmask 255.255.255.0 uproute add default gw 192.168.0.100
defaultroute
debian:/home/bester# cat /etc/rc.local ... ## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.lanwvdialexit 0
debian:/home/bester# ifconfigeth0 Link encap:Ethernet HWaddr 00:1a:92:15:aa:4c inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::21a:92ff:fe15:aa4c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:379 errors:0 dropped:0 overruns:0 frame:0 TX packets:1509 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:37979 (37.0 KiB) TX bytes:129089 (126.0 KiB) Interrupt:254 Base address:0x2000lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:408 errors:0 dropped:0 overruns:0 frame:0 TX packets:408 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:45680 (44.6 KiB) TX bytes:45680 (44.6 KiB)ppp0 Link encap:Point-to-Point Protocol inet addr:93.180.218.178 P-t-P:195.128.182.20 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:616 errors:0 dropped:0 overruns:0 frame:0 TX packets:716 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:305048 (297.8 KiB) TX bytes:202153 (197.4 KiB)
уточніть, що означає «з’єднання з інтернетом немає»?
що каже, наприклад, ping linux.org.ua ?
debian:/home/bester# ping google.com^C debian:/home/bester# ping 212.40.45.2PING 212.40.45.2 (212.40.45.2) 56(84) bytes of data.From 192.168.0.2 icmp_seq=2 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=3 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=4 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=6 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=7 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=8 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=10 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=11 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=12 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=13 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=14 Destination Host UnreachableFrom 192.168.0.2 icmp_seq=15 Destination Host Unreachable^C--- 212.40.45.2 ping statistics ---16 packets transmitted, 0 received, +12 errors, 100% packet loss, time 15022ms, pipe 3debian:/home/bester# landownLAN down successfully!debian:/home/bester# ping google.comPING google.com (209.85.171.100) 56(84) bytes of data.64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=2 ttl=238 time=518 ms64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=3 ttl=238 time=691 ms64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=4 ttl=238 time=558 ms^C64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=5ttl=238 time=500 ms--- google.com ping statistics ---5 packets transmitted, 4 received, 20% packet loss, time 4180msrtt min/avg/max/mdev = 500.895/567.415/691.521/74.685 msdebian:/home/bester# ping 212.40.45.2PING 212.40.45.2 (212.40.45.2) 56(84) bytes of data.64 bytes from 212.40.45.2: icmp_seq=1 ttl=58 time=309 ms64 bytes from 212.40.45.2: icmp_seq=2 ttl=58 time=298 ms64 bytes from 212.40.45.2: icmp_seq=3 ttl=58 time=312 ms64 bytes from 212.40.45.2: icmp_seq=4 ttl=58 time=302 ms64 bytes from 212.40.45.2: icmp_seq=5 ttl=58 time=315 ms^C--- 212.40.45.2 ping statistics ---5 packets transmitted, 5 received, 0% packet loss, time 4033msrtt min/avg/max/mdev = 298.041/307.476/315.246/6.439 ms
NetworkManager у вас запущений? Він може каку таку робити.
ifconfig eth0 192.168.0.2 netmask 255.255.255.0 uproute add -net 192.168.0.2 netmask 255.255.255.0 gw 192.168.0.100