Автор Тема: Моля помогнете за един router  (Прочетена 5087 пъти)

p3tzata_

  • Напреднали
  • *****
  • Публикации: 210
  • Distribution: Fedora
  • Window Manager: KDE
    • Профил
Моля помогнете за един router
« Отговор #15 -: Sep 11, 2007, 18:21 »
Може да не съм се изразил точно за това ще го илюстрирам

това е мрежата в момента:

Цитат
                     197.18.35.12-ppp0
                                        (komp)
                                  192.168.0.1 -eth0                                                                             |
                                            |
                                     (switch)
                                            |
               ................................................................
                |                           |                               |
          192.168.0.10      192.168.0.222-eth0    192.168.0.50
               (komp)                (komp)                     (komp)
                                  



а трябва да стане така без да правя настройки по 192.168.0.1
Цитат
                     197.18.35.12-ppp0
                                        (komp)
                                  192.168.0.1 -eth0                                                                            |
                                           |
                                     (switch)
                                            |
               ................................................................
                |                           |                               |
          192.168.0.10      192.168.0.222-eth0    192.168.0.50
                (komp)               (komp)                      (komp)
                                     192.168.3.1-eth1  
                                            |
                                            |
                                        (switch)
                                            |
        ......................................................................
                   |                          |                           |
         192.168.3.10          192.168.3.20      192.168.3.30
             (komp)                   (komp)                (komp)





Активен

Никое ДОБРО не води до ДОБРО и никое ЗЛО не води до ЗЛО.

dedmin

  • Напреднали
  • *****
  • Публикации: 456
    • Профил
Моля помогнете за един router
« Отговор #16 -: Sep 11, 2007, 20:07 »
Примерен код
#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

#
# delete all existing rules.
#
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X

# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT


# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

# Masquerade.
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

# Don't forward from the outside to the inside.
iptables -A FORWARD -i eth1 -o eth1 -j REJECT

# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward



Ето скрипта който аз ползвам. Който ползва Федора да каже къде да го сложиш.
Активен

Hapkoc

  • Напреднали
  • *****
  • Публикации: 2117
    • Профил
Моля помогнете за един router
« Отговор #17 -: Sep 11, 2007, 20:47 »
Сега, за Fedora най-културно би следвало да стане така май:

1. В /etc/sysctl.conf се добавя:

net.ipv4.ip_forward=1

2. Изпълнява се:

sysctl -w net.ipv4.ip_forward=1

3. Изпълнява се:

iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X

iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -d ! 192.168.3.0/24 -j SNAT --to-source 192.168.0.222
 
service iptables save


Това е май.

Всичко би трябвало да сработи при условие, че нещата са конфигурирани както на картинката, която си дал, т.е. на Fedora-та имаш на едната карта 192.168.0.222, на другата 192.168.3.1, а на машината с Windows имаш адрес 192.168.3.10 (или друг от същата мрежа), default gateway 192.168.3.1 (а не 192.168.0.1 както писах преди) и DNS сървъри тези на доставчика ти.

Не знам дали не си се отказал да четеш тука след като така и така си си решил проблема с Firestarter... Надявам се, че този път не съм написал пак някоя простотия. :)
Активен

p3tzata_

  • Напреднали
  • *****
  • Публикации: 210
  • Distribution: Fedora
  • Window Manager: KDE
    • Профил
Моля помогнете за един router
« Отговор #18 -: Sep 12, 2007, 12:56 »
Не съм се отказал да чета  '<img'> обаче преди да пробвам примерния код по-горе, ще помоля за малко помощ, че нещо се оплескаха интерфейсите с този Firestarter.

Когато отивам в Network Configuration-->Hardware ми се появява следното
 
Description         Type               Device          Status
 
Realtek             Ethernet           eth1            ok
nVidia               Ethernet          peth0           ok
bridge               Ethernet           eth0           system

ifconfig показва:

etho  192.168.0.222

eht1 192.168.3.1

peth0 (незнам си какво )

virbr0 (незнам си какво )
--------------------------------------------

когато изтрия графично този "bridge" и настройвам двете лан карит както следва

Description         Type               Device          Status
 
Realtek             Ethernet           eth1               ok
nVidia               Ethernet           eht0               ok

давам "Save"

после рестартирам : service network restart
и си мисля, че съм оправил всичко

и после като отивам пак в Network Configuration-->Hardware и виждам същото

Description         Type               Device          Status
 
Realtek             Ethernet           eth1            ok
nVidia               Ethernet          peth0           ok
bridge               Ethernet           eth0           system


Кажете как да го махна този "bridge"

П.П. Firestarter-a съм го направил да не се стартира



Активен

Никое ДОБРО не води до ДОБРО и никое ЗЛО не води до ЗЛО.

Hapkoc

  • Напреднали
  • *****
  • Публикации: 2117
    • Профил
Моля помогнете за един router
« Отговор #19 -: Sep 12, 2007, 13:29 »
Bridge-а би трябвало да си има файлче, нещо от рода на:

/etc/sysconfig/network-scripts/ifcfg-br0

Триеш го и не би трябвало да се появява повече при service network restart.
Активен

dedmin

  • Напреднали
  • *****
  • Публикации: 456
    • Профил
Моля помогнете за един router
« Отговор #20 -: Sep 12, 2007, 14:27 »
Цитат
Yup Simon Bridge is correct. You are booting into a xen kernel. The reason peth0 won't work is because xen by default looks for eth0. If it doesn't find it networking won't come up. When your machine boots check the menu closely. You should see a choice of Fedora Core (2.6.18-1.2849.fc6) and Fedora Core (2.6.18-1.2849.fc6xen) or something similar depending on your kernel version. Choose the one that does not have xen in it.

You can change the default by editing /boot/grub/menu.lst and changing the line default=<some number> The first line that starts with title would be 0, the 2nd line that starts with title would be 1 and so on in the <some number> part above. Be sure and take out the <> as well.


Цитат
What is in /var/log/xen ?
http://fedora.redhat.com/docs/releas...sn-Kernel.html
You seem to have the virtualisation kernel installed instead of the native one. It may be that you are running an FC6 VM in XEN running in FC6 host. But this is not the default behavior - leading to questions about how you installed FC6.

Anyway:

What xen does is relabel the network interfaces so that the MAC address comes under peth0, peth1 etc and the rest of the information comes under veth0, veth1 etc.

veth1 is supposed to get renamed as eth1

As pointed out earlier, your peth0 shows up all the time ... presumably corresponding to the mac addr. of your on-board network card. peth1 will hold the mac address of your wireless card. Check if veth1 exists when eth1 dosn't.

Xen handles virtual-hardware network connections via a bridge-process (xenbr0) which is quite complex but allows multiple virtual machines to believe they have exculsive use of the hardware. Keeps 'em happy.

Wireless networking is tricky over the bridging method, and is better handled via routing instead. However, as I have not done this (nor am I contemplating doing this) I don't know how one would route a wireless connection from a virtual machine. However - this should be the direction of your research if you don't want to reinstall FC6.

http://fedora.redhat.com/docs/releas...alization.html
http://fedoraproject.org/wiki/FedoraXenQuickstartFC6

I'd check the grub menue to see if there is a non-xen boot option.
Failing that - possibly installing a plain i686 (say) kernel and/or uninstalling the kernel-xen package. (Or reinstall, making sure the native kernel is installed.)

The SMP part is a red herring - fedora is no longer issues a seperate kernel for smp and up systems. The installer detects which is needed and sets the appropriate bits.

But here's something I'd like to clarify - when eth1 is not present, do you see peth0 listed with your wireless card statistics?


Няма да е зле по-често да ползваш Goooooogle.
Активен

p3tzata_

  • Напреднали
  • *****
  • Публикации: 210
  • Distribution: Fedora
  • Window Manager: KDE
    • Профил
Моля помогнете за един router
« Отговор #21 -: Sep 12, 2007, 16:13 »
Няма такъв файл /etc/sysconfig/network-scripts/ifcfg-br0 или подобен.

побвах с командата "brctl" изтрих всички мостове, които показа и пак като рестартирам компютъра пак ми се показва

Description         Type               Device          Status

Realtek             Ethernet           eth1            ok
nVidia               Ethernet          peth0           ok
bridge               Ethernet           eth0           system


Направо ще полудея  ':crazy:'
Активен

Никое ДОБРО не води до ДОБРО и никое ЗЛО не води до ЗЛО.

Dean79

  • Напреднали
  • *****
  • Публикации: 151
    • Профил
Моля помогнете за един router
« Отговор #22 -: Sep 13, 2007, 09:00 »
Дали ако размениш кабелите които влизат в eth0 и eth1 няма да се оправи '<img'>
Активен

Подобни теми
Заглавие Започната от Отговора Прегледи Последна публикация
Router
Настройка на програми
Wiz 4 2415 Последна публикация Apr 19, 2004, 03:01
от XaugyTuH
Router
Настройка на програми
jm 1 2165 Последна публикация May 30, 2004, 10:21
от Йордан
Router
Идеи и мнения
Devilhunter 5 2831 Последна публикация Sep 13, 2004, 21:59
от XaugyTuH
Router
Настройка на програми
Devilhunter 6 2893 Последна публикация Oct 27, 2004, 16:45
от
ssh win>>lx router>>lx router>>win
Настройка на програми
carlitto 0 1638 Последна публикация Apr 27, 2005, 10:43
от carlitto