Решено: Проблемы с роутингом (ACCEPT_KEYWORDS="x86")

Sabayon, Calculate, Funtoo, Exherbo

Модератор: /dev/random

Аватара пользователя
0xFF
Сообщения: 267
ОС: Gentoo

Решено: Проблемы с роутингом

Сообщение 0xFF »

Начнём :)

Код: Выделить всё

localhost ~ # cat /etc/conf.d/net
config_eth0=( "dhcp" )

config_eth1=( "dhcp" )
dhcp_eth1=( "nonis nodns nosendhost nogateway nontp" )
routes_eth1=("10.100.0.0/16 via 10.100.126.1")
localhost ~ #

Код: Выделить всё

localhost ~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:00:21:f8:8f:18
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::200:21ff:fef8:8f18/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:112046 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76428 errors:0 dropped:0 overruns:0 carrier:0
          collisions:11 txqueuelen:1000
          RX bytes:143220540 (136.5 MiB)  TX bytes:7448901 (7.1 MiB)
          Interrupt:17 Base address:0xd000

eth1      Link encap:Ethernet  HWaddr 00:19:5b:72:28:f8
          inet addr:10.100.126.22  Bcast:10.100.126.255  Mask:255.255.255.0
          inet6 addr: fe80::219:5bff:fe72:28f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:121165 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138341 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13196103 (12.5 MiB)  TX bytes:147989295 (141.1 MiB)
          Interrupt:18 Base address:0xc000

lo        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:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:384 (384.0 B)  TX bytes:384 (384.0 B)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.200.1  P-t-P:192.168.200.101  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1396  Metric:1
          RX packets:71237 errors:0 dropped:0 overruns:0 frame:0
          TX packets:106637 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:4723801 (4.5 MiB)  TX bytes:137928858 (131.5 MiB)

ppp1      Link encap:Point-to-Point Protocol
          inet addr:192.168.200.1  P-t-P:192.168.200.100  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
          RX packets:4091 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3542 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:854954 (834.9 KiB)  TX bytes:2640417 (2.5 MiB)

localhost ~ #

Код: Выделить всё

localhost ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.200.101 *               255.255.255.255 UH    0      0        0 ppp0
192.168.200.100 *               255.255.255.255 UH    0      0        0 ppp1
host-91-189-165 10.100.126.1    255.255.255.252 UG    1      0        0 eth1
10.100.126.0    *               255.255.255.0   U     1      0        0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
10.100.0.0      10.100.126.1    255.255.0.0     UG    1      0        0 eth1
192.168.0.0     10.100.126.1    255.255.0.0     UG    1      0        0 eth1
172.16.0.0      10.100.126.1    255.240.0.0     UG    1      0        0 eth1
10.0.0.0        10.100.126.1    255.0.0.0       UG    1      0        0 eth1
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
localhost ~ #

Т.е. получаем, что 192.168.0.0 с маской 255.255.0.0 идёт через 10.100.126.1 и команда dhcp_eth1=( "nonis nodns nosendhost nogateway nontp" ) не работает :(
Тем не менее интернет доступен, тот, который через роутер 192.168.1.1, но приблизительно пол дня, потом магическим образом его нет (вероятно получение параметров по DHCP для одного из сетевых интерфейсов срабатывает).
Проблема вобщем-то понятна, но как её решить, пока не догнал :( Может кто сталкивался? :)

P.S. Диапазон 192.168.200.0/24 предполагается для раздачи интернета через pptp-сервер. Разные MTU - потому что один клиент виндовый, другой линуксовый, в настройках pptp-сервера MTU явно не указан.
Спасибо сказали:
Аватара пользователя
0xFF
Сообщения: 267
ОС: Gentoo

Re: Решено: Проблемы с роутингом

Сообщение 0xFF »

Получил желаемый результат, поменяв стандартного клиента "dhcpcd" на "udhcpc":

Код: Выделить всё

localhost ~ # cat /etc/conf.d/net
#modules=( "ifconfig" )

modules_eth0=( "udhcpc" )
modules_eth1=( "udhcpc" )

config_eth0=( "dhcp" )
mtu_eth0="1396"

config_eth1=( "dhcp" )
dhcp_eth1="nodns nontp nonis nogateway nosendhost"
routes_eth1=( "10.100.0.0/16 via 10.100.126.1" )
localhost ~ #

Код: Выделить всё

localhost ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.200.101 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
10.100.126.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.100.0.0      10.100.126.1    255.255.0.0     UG    1      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
localhost ~ #
Спасибо сказали: