<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Проблемы с элементарным шлюзом]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=14668&amp;type=atom" />
	<updated>2011-06-25T22:23:05Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=14668</id>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с элементарным шлюзом]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=190655#p190655" />
			<content type="html"><![CDATA[<p>GATEWAY=192.168.1.2<br />Мастер хост для виртуалок, компьютер на котором установленн Virtual Box</p>]]></content>
			<author>
				<name><![CDATA[belartvlad80]]></name>
				<uri>https://linuxforum.ru/profile.php?id=18044</uri>
			</author>
			<updated>2011-06-25T22:23:05Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=190655#p190655</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с элементарным шлюзом]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=190654#p190654" />
			<content type="html"><![CDATA[<p>GATEWAY=192.168.1.2<br />Мастер хост для виртуалок, компьютер на котором установленн Virtual Box</p>]]></content>
			<author>
				<name><![CDATA[belartvlad80]]></name>
				<uri>https://linuxforum.ru/profile.php?id=18044</uri>
			</author>
			<updated>2011-06-25T22:21:54Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=190654#p190654</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с элементарным шлюзом]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=190607#p190607" />
			<content type="html"><![CDATA[<p>Меня смущают два вопроса:<br />1. зачем использовать маскарад, если у вас ip постоянные?<br />ИМХО так правильнее будет:<br /><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j SNAT --to-source 192.168.1.30</div><br />2. Что это за комп такой?</p><div class="quotebox"><cite>belartvlad80 пишет:</cite><blockquote><p>GATEWAY=192.168.1.2</p></blockquote></div><p>Ещё один шлюз?</p>]]></content>
			<author>
				<name><![CDATA[Vadimsky]]></name>
				<uri>https://linuxforum.ru/profile.php?id=411</uri>
			</author>
			<updated>2011-06-25T17:27:17Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=190607#p190607</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с элементарным шлюзом]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=190602#p190602" />
			<content type="html"><![CDATA[<p>А зачем в /etc/sysconfig/network добавлять<br /></p><div class="codebox"><pre><code>FORWARD_IPV4=YES</code></pre></div><p>Вот пример моего<br /><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">NETWORKING=yes<br />NETWORKING_IPV6=no<br />HOSTNAME=ldap.mgkb1.local<br />GATEWAY=192.168.1.1</div></p><p>И для удобства сделайте одолжение, заключите в теги выдержки с консоли.</p>]]></content>
			<author>
				<name><![CDATA[XliN]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6412</uri>
			</author>
			<updated>2011-06-25T17:17:34Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=190602#p190602</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Проблемы с элементарным шлюзом]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=190596#p190596" />
			<content type="html"><![CDATA[<p>Здравствуйте профессионалы, помогите пожайлуста новичку в Linux системах.</p><p>Конфигурация системы следующая. В Virtual Box есть две виртуальные машины<br />одну я хотел использовать в качестве шлюза Centos 2.6.18 - 8.1.6.e15 с двумя сетевыми интерфейсами eth0(внешний) и eth1(внутренний). Вторая машинка рабочая станция WinXPSP3 c одним внутренним сетевым интерфейсом.<br />Сетевые параметры:<br />На Centos&nbsp; &nbsp; &nbsp; файл /etc/sysconfig/network-scripts/ifcfg-eth0:<br />&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; DEVICE=eth0<br />&nbsp; &nbsp; &nbsp; &nbsp; BROADCAST=192.168.1.255<br />&nbsp; &nbsp; &nbsp; &nbsp; HWADDR=08:00:27:26:4E:A5<br />&nbsp; &nbsp; &nbsp; &nbsp; IPADDR=192.168.1.30<br />&nbsp; &nbsp; &nbsp; &nbsp; NETMASK=255.255.255.0<br />&nbsp; &nbsp; &nbsp; &nbsp; NETWORK=192.168.1.0<br />&nbsp; &nbsp; &nbsp; &nbsp; GATEWAY=192.168.1.2<br />&nbsp; &nbsp; &nbsp; &nbsp; ONBOOT=yes<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; файл /etc/sysconfig/network-scripts/ifcfg-eth1:<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; DEVICE=eth1<br />&nbsp; &nbsp; &nbsp; &nbsp; BROADCAST=192.168.10.255<br />&nbsp; &nbsp; &nbsp; &nbsp; HWADDR=08:00:27:BB:7C:82<br />&nbsp; &nbsp; &nbsp; &nbsp; IPADDR=192.168.10.1<br />&nbsp; &nbsp; &nbsp; &nbsp; NETMASK=255.255.255.0<br />&nbsp; &nbsp; &nbsp; &nbsp; NETWORK=192.168.10.0<br />&nbsp; &nbsp; &nbsp; &nbsp; GATEWAY=192.168.1.30<br />&nbsp; &nbsp; &nbsp; &nbsp; ONBOOT=yes</p><p>На XP сетевые настройки TCP/IP:<br />&nbsp; &nbsp; &nbsp; &nbsp; IP-адрес&nbsp; &nbsp; 192.168.10.2<br />&nbsp; &nbsp; &nbsp; &nbsp; Маска подсети&nbsp; &nbsp; 255.255.255.0&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; Основной шлюз&nbsp; &nbsp; 192.168.10.1</p><p>На Centos:</p><p>В файле &nbsp; &nbsp; /etc/sysctl.conf выставляю следующий параметр в 1<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; net.ipv4.ip_forward = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />ввожу следующие команды:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<br />&nbsp; &nbsp; &nbsp; &nbsp; service iptables save<br />&nbsp; &nbsp; &nbsp; &nbsp; service iptables restart</p><p>в /etc/sysconfig/network</p><p>&nbsp; &nbsp; &nbsp; &nbsp; FORWARD_IPV4=YES</p><p>Перезапускаю сетевую подсистему <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; service network restart</p><p>И тут мне выдаётся<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; Shutting down interface eth0:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; Shutting down interface eth1:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; Shutting down loopback interface:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]<br />Disabling IPv4 packet forwarding:&nbsp; net.ipv4.ip_forward = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[&nbsp; OK&nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; Bringing up loopback interface:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; Bringing up interface eth0:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; Bringing up interface eth1:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; OK&nbsp; ]</p><p>В четвёртой строчке мне выдаётся что форвардинг не работает и тот параметр который я на первом шаге ставил в 1 обнуляется для системы и делает невозможным работу шлюза. Хотя после этого всего </p><p> &nbsp; &nbsp; &nbsp; &nbsp; cat /proc/sys/net/ipv4/ip_forward выдаёт 1<br />&nbsp; &nbsp; &nbsp; &nbsp; Мистика какая-то !!!</p><p>Проверяю маршрутизацию netstat -r выдаёт следующее</p><p>Kernel IP routing table<br />Destination&nbsp; &nbsp; &nbsp;Gateway&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Genmask&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Flags&nbsp; &nbsp;MSS Window&nbsp; irtt Iface<br />192.168.1.0&nbsp; &nbsp; &nbsp;*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;255.255.255.0&nbsp; &nbsp;U&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 eth0<br />192.168.10.0&nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;255.255.255.0&nbsp; &nbsp;U&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 eth1<br />169.254.0.0&nbsp; &nbsp; &nbsp;*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;255.255.0.0&nbsp; &nbsp; &nbsp;U&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 eth1<br />default&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pc001&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UG&nbsp; &nbsp; &nbsp; &nbsp; 0 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 eth0</p><p>Тоже странно внутрення сеть 192.168.10.0 без явного шлюза хотя вроде как прописал</p><p>Вообщем помогите разобраться. Заранее спасибо !!!</p>]]></content>
			<author>
				<name><![CDATA[belartvlad80]]></name>
				<uri>https://linuxforum.ru/profile.php?id=18044</uri>
			</author>
			<updated>2011-06-25T16:17:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=190596#p190596</id>
		</entry>
</feed>
