LINUX.ORG.RU
ФорумAdmin

виртуальные интерфейсы


0

0

Здравствуйте. Как можно повешать какой-либо виртуальный интерфейс на eth0? В сети же он будет выглядеть как отдельное устройство с ip адресом?

anonymous

Ответ на: комментарий от chucha

А какие еще настройки должны бать в системе? Форвадинг? Я поставил, но в сети не появляется, не пингуется и не отвечает на арп запросы. Стоит фаерволл еще, который блокирует все кроме определенных. Может что еще туда добавить надо? (я попробовал добавить любые входящие на eth0:1, нописал что неизвестный алис).

anonymous
()
Ответ на: комментарий от chucha

ifconfig: eth0 Link encap:Ethernet HWaddr 4C:00:10:3A:5C:3B inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:20151 errors:0 dropped:0 overruns:0 frame:0 TX packets:27485 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2067668 (1.9 Mb) TX bytes:28691842 (27.3 Mb) Interrupt:9 Base address:0x9000

eth0:1 Link encap:Ethernet HWaddr 4C:00:10:3A:5C:3B inet addr:192.168.0.13 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:9 Base address:0x9000

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1174 errors:0 dropped:0 overruns:0 frame:0 TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:99686 (97.3 Kb) TX bytes:99686 (97.3 Kb)

iptables -L: Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere bad_tcp_packets tcp -- anywhere anywhere ACCEPT icmp -- anywhere anywhere ACCEPT all -- localhost anywhere ACCEPT all -- r0y anywhere ACCEPT all -- localnet/24 anywhere state RELATED,ESTABLISHED tcp_packets tcp -- localnet/24 anywhere udp_packets udp -- localnet/24 anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy DROP) target prot opt source destination

Chain OUTPUT (policy DROP) target prot opt source destination DROP all -- anywhere anywhere OWNER UID match tim DROP all -- anywhere anywhere OWNER UID match 1004 ACCEPT all -- localhost anywhere ACCEPT all -- r0y anywhere ACCEPT all -- anywhere anywhere

Chain allowed (4 references) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED DROP tcp -- anywhere anywhere

Chain bad_tcp_packets (1 references) target prot opt source destination REJECT tcp -- anywhere anywhere tcp flags:SYN,ACK/SYN,ACK state NEW reject-with tcp-reset DROP tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW

Chain icmp_packets (0 references) target prot opt source destination DROP icmp -- anywhere anywhere icmp echo-request ACCEPT icmp -- anywhere anywhere

Chain tcp_packets (1 references) target prot opt source destination allowed tcp -- localnet/24 anywhere tcp dpt:ssh allowed tcp -- localnet/24 anywhere tcp dpt:netbios-ssn allowed tcp -- localnet/24 anywhere tcp dpt:ircd allowed tcp -- localnet/24 anywhere tcp dpt:6670 REJECT tcp -- localnet/24 anywhere reject-with tcp-reset

anonymous
()
Ответ на: комментарий от chucha

ifconfig:
eth0 Link encap:Ethernet HWaddr 4C:00:10:3A:5C:3B
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20151 errors:0 dropped:0 overruns:0 frame:0
TX packets:27485 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2067668 (1.9 Mb) TX bytes:28691842 (27.3 Mb)
Interrupt:9 Base address:0x9000

eth0:1 Link encap:Ethernet HWaddr 4C:00:10:3A:5C:3B
inet addr:192.168.0.13 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:9 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1174 errors:0 dropped:0 overruns:0 frame:0
TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:99686 (97.3 Kb) TX bytes:99686 (97.3 Kb)

iptables -L:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
bad_tcp_packets tcp -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- localhost anywhere
ACCEPT all -- r0y anywhere
ACCEPT all -- localnet/24 anywhere state RELATED,ESTABLISHED
tcp_packets tcp -- localnet/24 anywhere
udp_packets udp -- localnet/24 anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy DROP)
target prot opt source destination

Chain OUTPUT (policy DROP)
target prot opt source destination
DROP all -- anywhere anywhere OWNER UID match tim
DROP all -- anywhere anywhere OWNER UID match 1004
ACCEPT all -- localhost anywhere
ACCEPT all -- r0y anywhere
ACCEPT all -- anywhere anywhere

Chain allowed (4 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED
DROP tcp -- anywhere anywhere

Chain bad_tcp_packets (1 references)
target prot opt source destination
REJECT tcp -- anywhere anywhere tcp flags:SYN,ACK/SYN,ACK state NEW reject-with tcp-reset
DROP tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW

Chain icmp_packets (0 references)
target prot opt source destination
DROP icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere

Chain tcp_packets (1 references)
target prot opt source destination
allowed tcp -- localnet/24 anywhere tcp dpt:ssh
allowed tcp -- localnet/24 anywhere tcp dpt:netbios-ssn
allowed tcp -- localnet/24 anywhere tcp dpt:ircd
allowed tcp -- localnet/24 anywhere tcp dpt:6670
REJECT tcp -- localnet/24 anywhere reject-with tcp-reset

P.S. прошу прощения за форматирование, забыл.

anonymous
()
Ответ на: комментарий от anonymous

Без фаервола все работает. Что нужно добавить в правила? пробовал: iptables -I INPUT -p ALL -i eth0:1 -j ACCEPT iptables -I OUTPUT -p ALL -o eth0:1 -j ACCEPT Говорил: Warning: wierd character in interface `eth0:1' (No aliases, :, ! or *). Но првило добавлял, однако пинг на новый ip не проходил.

anonymous
()
Ответ на: комментарий от anonymous

Насколько я помню фаервол не поддерживает работу с виртуальными инфейсами

anonymous
()
Ответ на: комментарий от anonymous

Попробуй указывать не интерфейс а сеть

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.